pool_stream

0.0.3 • Public • Published

Pool Stream

It's like a pool. Upstream can fast pipe into it, and don't depend on the downstream.

Installation

$ npm install pool_stream

Usage

You can pipe it like other streams.

var PoolStream = require('pool_stream');
 
var readable = fs.createReadStream('a_file');
var pool = new PoolStream();
var writable = fs.createWriteStream('b_file');
 
readable.pipe(pool).pipe(writable);
 
// following events will tell you why need pool.
readable.on('end', function () {
  console.log('readable end time is: %s', new Date());
});
pool.on('end', function () {
  console.log('pool end time is: %s', new Date());
});
pool.on('finish', function () {
  console.log('pool finish time is: %s', new Date());
});
writable.on('finish', function () {
  console.log('writable finish time is: %s', new Date());
});

License

The MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    3
  • 0.0.2
    13
  • 0.0.1
    0

Package Sidebar

Install

npm i pool_stream

Weekly Downloads

16

Version

0.0.3

License

MIT

Last publish

Collaborators

  • jacksontian