fn-stack

Runs functions asynchronously.

npm install fn-stack
1 downloads in the last week
29 downloads in the last month

fn-stack

Use functions as generic middleware (similar to stack by @creationix).

Installation

Via npm:
$ npm install fn-stack

Via git:

$ git clone https://github.com/sbruchmann/fn-stack  
$ 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.");
});
npm loves you