0.1.0 • Published 10 years ago

sequence-stream v0.1.0

Weekly downloads
36
License
MIT
Repository
github
Last release
10 years ago

sequence-stream

Build Status

gather a sequence of streams into a single stream.

var Readable = require('readable-stream/readable');
var seq = require('sequence-stream');

var a = new Readable();
var b = new Readable(); 
var c = new Readable();

seq([a, b, c]).pipe(process.stdout);

a.push('1');
b.push('4');
c.push('7');

a.push('2');
b.push('5');
c.push('8');

a.push('3');
b.push('6');
c.push('9');

a.push(null);
b.push(null);
c.push(null);

// 123456789

install

node:

$ npm install sequence-stream

api

seq(streams[, opts])

Creates a new stream from the given array of streams. Each stream in the given array is paused until the stream immediately before it has finished, at which point it will be resumed and have its output passed through the sequence stream.

If opts are given, they will be used as the options to use to initialise the new stream.

The returned stream is a q-stream, and is thus technically a Transform stream.