Simple Express.js middleware to handle exceptions and catch error within express routes in asynchronous and pass them to your express error handlers.
npm install @dimosbotsaris/express-async-handler> Simple Express.js middleware to handle exceptions and catch error within express routes in asynchronous and pass them to your express error handlers.
``sh`
npm install --save @dimosbotsaris/express-async-handler
`ts
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)
}))
`
`sh``
npm run test
š¤ Dimos Botsaris
* Website: https://www.eldimious.com
* Twitter: @el_dimious
* Github: @eldimious
* LinkedIn: @dimosthenis-botsaris-5ab16485

Give a āļø if this project helped you!