multi-pipe-stream

1.0.1 • Public • Published

Multi-Pipe-Stream

A writable stream that can be piped to multiple other writable streams.

Installation

npm i multi-pipe-stream -S

API

pipeTo

// @stream - A stream to pipe to
myMultiStream.pipeTo(stream);

unpipeFrom

// @stream - A stream that is already being piped to
myMultiStream.unpipeFrom(stream);

Code Example

var MultiStream = require('multi-pipe-stream');

// Create a new MultiStream
var stream = new MultiStream();

// Pipe the original stream to the MultiStream
originalStream.pipe(stream);

// Add multiple pipes out from this stream to multiple destinations
stream.pipeTo(destStream1);
stream.pipeTo(destStream2);

// Remove a destination stream from being piped to
stream.unpipeFrom(destStream1);

Package Sidebar

Install

npm i multi-pipe-stream

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • connorcetgi