fn-stack
Use generic middleware in your JavaScript applications (similar to stack by creationix).
Installation
Via npm:
$ npm install fn-stack
Via git:
$ git clone git@github.com:sbruchmann/fn-stack.git
$ cd fn-stack/
$ npm install
Usage
"use strict";
var FNStack = require("fn-stack");
var stack = new FNStack();
stack.push(function log(value, next) {
process.nextTick(function() {
console.log(value); // => "Hello, world!"
next(null);
});
});
stack.run(["Hello, world!"], function onDone(err) {
if (err) {
throw err;
}
console.log("Done.");
});