JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 166153
  • Score
    100M100P100Q164935F
  • License MIT

Express Error Handler for Async Functions

Package Exports

  • express-async-handler

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-async-handler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Simple middleware for handling exceptions inside of async express routes.

Instalation:

npm install --save express-async-handler
yarn add express-async-handler

Usage:

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

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