express-async-handler
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Simple middleware for handling exceptions inside of async express routes and passing them to your express error handlers.

Installation:

npm install --save express-async-handler

or

yarn add express-async-handler

Usage:

const asyncHandler = require('express-async-handler')

express.get('/', asyncHandler(async (req, res, next) => {
	const bar = await foo.findAll();
	res.send(bar)
}))

Import in Typescript:

import * as asyncHandler from 'express-async-handler'

Package Sidebar

Install

npm i express-async-handler@1.0.3

Version

1.0.3

License

MIT

Last publish

Collaborators

  • abazhenov