Skip to content

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

Notifications You must be signed in to change notification settings

mk-pmb/unix-pipe-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published