0.1.2 • Published 8 years ago

tubing v0.1.2

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

tubing

Simple Pielines

Installation

npm install tubing

Usage

var tubing = require('tubing');

function readFile(cmd, done) {
  require('fs').readFile(cmd.path, function(err, data) {
    if (err) return done(err);
    cmd.content = data;
    done();
  });
}

function removeNewLines(cmd, done) {
  cmd.content = cmd.content.replace(/\n/g, '');
  done()
}

var TestPipeline = tubing.pipeline('Test Pipeline')
  .then(readFile)
  .then(removeNewLines);

var loggingSink = tubing.sink(function(err, cmd) {
  if (err) return console.log(err.stack);
  console.log(cmd);
});

var pipeline = TestPipeline.configure().publish_to(loggingSink);
pipeline.push({path: '/tmp/foo.txt'});

License

Copyright (c) 2013 Matt Insler Licensed under the MIT license.

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago