node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »


Functional Compose

A function for performing functional composition. There are grab bag libraries that have this functionality. But no library present at the time of creation that only provided functional composition


var compose = require("functional-compose");
var words   = function(text)  { return text.split(" "); };
var unwords = function(words) { return lines.join(" "); };
var reverse = function(words) { return lines.reverse();  };
var reverseSentence = compose(unwords, reverse, words);
console.log("yo dog, i heard you like functional composition");