unix-pipe
v0.1.6
Published
Alternate interface to the posix-pipe package. Maybe some day I'll add a fallback for compatibility with other operating systems.
Downloads
16
Readme
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