@dimosbotsaris/express-async-handler
v1.1.2
Published
Simple Express.js middleware to handle exceptions and catch error within express routes in asynchronous and pass them to your express error handlers.
Maintainers
Readme
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-handlerUsage
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 testAuthor
👤 Dimos Botsaris
- Website: https://www.eldimious.com
- Twitter: @el_dimious
- Github: @eldimious
- LinkedIn: @dimosthenis-botsaris-5ab16485
Support Me
Show your support
Give a ⭐️ if this project helped you!
