forking-stream

1.0.0 • Public • Published

forking-stream

Build Status

Turning one stream into many

Example:

'use strict';
 
const ForkingStream = require('forking-stream');
const through       = require('through2');
 
let stream = new ForkingStream;
 
stream.createReadStream().pipe(through(function(chunk, enc, next) {
  this.push("++  " + chunk.toString());
  next();
})).pipe(process.stdout);
 
let read = stream.createReadStream();
 
read.pipe(through(function(chunk, enc, next) {
  this.push("--> " + chunk.toString());
  next();
})).pipe(process.stdout);
 
setTimeout(() => {
  read.destroy();
}, 3000);
 
setInterval(() => {
  stream.write('Hello, World!\n');
}, 100);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i forking-stream

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • bthesorceror