basic-pipeline

A basic pipeline module for node

npm install basic-pipeline
2 downloads in the last week
20 downloads in the last month

basic-pipeline

A basic pipeline module for node

Installation

$ npm install basic-pipeline --save

Usage

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 (context, next) {
    context.foo = "bar";

    next();
});

pipeline.use(function (context, next) {
    context.bar = "baz";

    next();
});

pipeline.use(function (context, next) {
    context.theAnswerIs = "42";

    next();
});

pipeline.execute({}, function (err, context) {
    console.log(context);
});

//context => { foo: 'bar', bar: 'baz', theAnswerIs: '42' }
npm loves you