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

1.1.0 • Public • Published

Express async handler

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

Installation

npm install @robinblomberg/express-async-handler

Usage

import { asyncHandler } from '@robinblomberg/express-async-handler';

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

Readme

Keywords

none

Package Sidebar

Install

npm i @robinblomberg/express-async-handler

Weekly Downloads

5

Version

1.1.0

License

none

Unpacked Size

3.58 kB

Total Files

5

Last publish

Collaborators

  • robinblomberg