unix-pipe

0.1.6 • Public • Published

unix-pipe

Alternate interface to the posix-pipe package. Maybe some day I'll add a fallback for compatibility with other operating systems.

Usage

from test.usage.js:

var unixPipe = require('unix-pipe'), coll = require('collect-stream'),
  portal = unixPipe(), wormhole = unixPipe();
 
equal(typeof portal.rd.fd, 'number');
equal(typeof portal.wr.fd, 'number');
portal.wr.write('There will be cake!\n');
 
equal(typeof wormhole.output.fd, 'number');
equal(typeof wormhole.input.fd, 'number');
wormhole.input.write('omnom\n');
 
setTimeout(function () {
  portal.wr.end();
  wormhole.wr.end();
}, 50);
 
async.map([ portal.rd, wormhole.output ], coll, function verify(err, stuff) {
  equal(err, null);
  equal(stuff.map(String), [
    'There will be cake!\n',
    'omnom\n',
  ]);
  console.log("+OK usage test passed.");
});

Known issues

  • needs more/better tests and docs

 

License

ISC

Readme

Keywords

Package Sidebar

Install

npm i unix-pipe

Weekly Downloads

3

Version

0.1.6

License

ISC

Unpacked Size

6.39 kB

Total Files

4

Last publish

Collaborators

  • mk-pmb