All Projects → blakeembrey → Async Middleware

blakeembrey / Async Middleware

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

Programming Languages

typescript
32286 projects

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].