chain.js

1.0.0 • Public • Published

Chain.js

A utility for chaining together functions. It was inspired by connect.

Usage

var Chain = require('chain');
var func1 = function(a,b,next) {
  console.log("In func1, a is", a, "and b is", b);
  return next(a++,++b);
}
var func2 = function(a,b) {
  console.log("In func2, a is", a, "and b is", b);
  return "YAY";
}

var chained = new Chain(func1);
chained.use(func2);
console.log(chained(5,12));

Readme

Keywords

none

Package Sidebar

Install

npm i chain.js

Weekly Downloads

0

Version

1.0.0

License

BSD 2 Clause

Last publish

Collaborators

  • nykac