1.0.0 • Published 8 years ago

necklace v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Necklace: Easy Pipelines for JavaScript

npm install --save necklace

This library is really easy to use -- there's only 2 functions.

Example 1

necklace.define("echo", function (input, next) {
  next(null, input);
})
necklace.run("echo", "Hello World!")

Example 2

necklace.define("word", function (input, next) {
  next(null, input.split(/\s+/));
})
necklace.define("reverse", function (input, next) {
  next(null, input.reverse());
})
necklace.define("join", function (input, next) {
  next(null, input.join(' '));
})
necklace.run(["word", "reverse", "join"], "dog lazy the over jumps fox brown quick The", function (err, result) {
  // result = "The quick brown fox jumps over the lazy dog"
});