Fancy function composition for JavaScript.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE.txt
README.md
braid.js
package.json

README.md

Braid

Fancy function composition for JavaScript.

Show me how

// Create a new function from several other functions.
var combinedFn = braid.compose(
  fn1,               // Use any number of function references
  fn2,
  [fn3, arg1, arg2], // You can provide a function with additional arguments
  fn4
);

// Now, let's use the returned function.
var value1 = combinedFn('abc');
var value2 = combinedFn('def');

// You can also pipe a value directly through a set of functions, returning
// the result.
var value = braid.pipe('ghi', fn1, fn2, [fn3, arg1, arg2], fn4);

Installing

npm install braid