You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

middleware-async

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

middleware-async - npm Package Compare versions

Comparing version

to
1.2.4

2

package.json
{
"name": "middleware-async",
"version": "1.2.3",
"version": "1.2.4",
"description": "A handy tool to work with async/promise express middleware",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -86,3 +86,3 @@ # Async Middleware [![Build Status](https://travis-ci.org/tranvansang/middleware-async.svg?branch=master)](https://travis-ci.org/tranvansang/middleware-async)

`await middlewareToPromise(mdw)(req, res)` is rejected if the middleware `mdw` throws error (in **express/connect-like** style), otherwise the promise is resolved normally.
`await middlewareToPromise(mdw)(req, res)` is rejected if the middleware `mdw` throws error (in **express/connect-like style via calling next(err)**), otherwise the promise is resolved normally.

@@ -93,2 +93,4 @@ - `combineToAsync`: combination of `middleewareToPromise` and `combineMiddlewares`

Besides, I highly recommend using [flip-promise](https://www.npmjs.com/package/flip-promise) package to assert a rejected promise.
## Sample usages

@@ -95,0 +97,0 @@