basic-pipeline

A basic pipeline module for node and the web

basic-pipeline

A basic pipeline module for node and the web

$ npm install basic-pipeline --save
$ bower install basic-pipeline --save

Add steps to a pipeline with use. Then execute those steps in order with execute.

var Pipeline = require("basic-pipeline");
 
var pipeline = new Pipeline();
 
pipeline.use(function (contextnext) {
    context.foo = "bar";
 
    next();
});
 
pipeline.use(function (contextnext) {
    context.bar = "baz";
 
    next();
});
 
pipeline.use(function (contextnext) {
    context.theAnswerIs = "42";
 
    next();
});
 
pipeline.execute({}, function (errcontext) {
    console.log(context);
});
 
//context => { foo: 'bar', bar: 'baz', theAnswerIs: '42' }