jsmw
npm install jsmw
for a simple middleware pattern implementation on top of async.series
.
// Require a function.const jsmw = ;// Create the chain of middlewares.const chain =;// Execute your chain with different contexts.const context = {};chain;// Supports nested chains (context passed from outer one).const nestingContext = {};const nestedChain =;nestedChain;
Tests have more examples.
Compatibility
Works with node >=4
by default, but should run anywhere async does, with transpilation being required for some JS environments.