1.1.2 ā€¢ Published 2 years ago

@dimosbotsaris/express-async-handler v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Simple Express.js middleware to handle exceptions and catch error within express routes in asynchronous and pass them to your express error handlers.

Install

npm install --save @dimosbotsaris/express-async-handler

Usage

import express, { Request, Response, NextFunction, Router } from 'express';
import { asyncWrapper } from '@dimosbotsaris/express-async-handler';

express.get('/', asyncWrapper(async (req: Request, res: Response, next: NextFunction) => {
  const baz = await foo.findAll();
  res.send(baz)
}))

Run tests

npm run test

Author

šŸ‘¤ Dimos Botsaris

Support Me

ko-fi

Show your support

Give a ā­ļø if this project helped you!