tranxpress
Version:
A smart async wrapper for Express with MongoDB transaction support.
18 lines (15 loc) • 358 B
text/typescript
import { Request, Response, NextFunction } from "express";
export interface AsyncHandlerOptions {
useTransaction?: boolean;
customErrorHandler?: (
error: any,
req: Request,
res: Response,
next: NextFunction
) => Promise<void> | void;
}
export type AsyncFn = (
req: Request,
res: Response,
next: NextFunction
) => Promise<void>;