Socket
Socket
Sign inDemoInstall

middleware-flow

Package Overview
Dependencies
6
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.1 to 0.7.0

test/test-bg.js

8

index.js
var createCount = require('callback-count');
var noop = require('101/noop');

@@ -92,2 +93,9 @@ var flow = module.exports = {};

flow.try = require('./lib/try-catch')(flow.mwIf);
flow.bg = flow.background = function (/* middlewares */) {
var mw = flow.series.apply(flow, arguments);
return function (req, res, next) {
mw(req, res, noop);
next();
};
};

@@ -94,0 +102,0 @@ function thenAndElse (exec, conditional) {

4

package.json
{
"name": "middleware-flow",
"version": "0.6.1",
"version": "0.7.0",
"description": "Middleware control flow library: series, parallel, or, and",

@@ -27,3 +27,3 @@ "main": "index.js",

"dependencies": {
"101": "^0.6.0",
"101": "^0.16.1",
"callback-count": "0.0.3"

@@ -30,0 +30,0 @@ },

@@ -155,3 +155,12 @@ # middleware-flow [![Build Status](https://travis-ci.org/tjmehta/middleware-flow.png?branch=master)](https://travis-ci.org/tjmehta/middleware-flow)

## bg(middlewares...)
```js
app.use(
flow.bg(mw1, mw2, mw2)
); // runs the middlewares in series in the background
```
# License
### MIT
### MIT

@@ -7,4 +7,4 @@ var express = require('express');

var app = express();
app.use(express.bodyParser());
middlewares.forEach(function (mw) {
app.use(express.bodyParser());
app.use(mw);

@@ -11,0 +11,0 @@ });

@@ -28,2 +28,2 @@ var res = module.exports = {

}
};
};

Sorry, the diff of this file is not supported yet

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