express-async-middleware

1.0.1 • Public • Published

express-async-middleware

This an async middleware for express, used to catch errors from async functions and redirect them to the error handler.

Usage

const asyncMiddleware = require('express-async-middleware');

const fn = async (req, res) => {
  // await something

  res.send('ok');
};

app.get('/path', asyncMiddleware(fn));

Readme

Keywords

none

Package Sidebar

Install

npm i express-async-middleware

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

716 B

Total Files

3

Last publish

Collaborators

  • pan1994