Socket
Socket
Sign inDemoInstall

async-middleware

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    async-middleware

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


Version published
Weekly downloads
3.5K
increased by6.83%
Maintainers
1
Install size
10.8 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 07 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc