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

1.2.1 • Public • Published

Async Middleware

NPM version NPM downloads Build status Test coverage Greenkeeper badge

Wrap an asynchronous middleware (or handler) function for Express, Connect, router, etc.

Installation

npm install async-middleware --save

Usage

Wrap a middleware function using async and/or promises to catch errors and forward them to next(err).

var express = require('express')
var wrap = require('async-middleware').wrap
 
var app = express()
 
app.use(wrap(function (req, res) {
  return Promise.reject(new Error('boom!'))
}))

License

MIT

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i async-middleware

    Weekly Downloads

    2,844

    Version

    1.2.1

    License

    MIT

    Last publish

    Collaborators

    • blakeembrey