collect

collect a bunch of streams and wait til they've finished

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
collect
0.3.59 years ago10 years agoMinified + gzip package size for collect in KB

Readme

collect
Collect waits for a bunch of streams to end and then calls back. Easy.

install

npm install collect

usage

var fs = require('fs');
var Collection = require('collect');

var potatoStream = fs.createWriteStream('potato.txt');
var carrotStream = fs.createWriteStream('carrot.txt');
var bananaStream = fs.createWriteStream('banana.txt');

var collection = Collection([potatoStream, carrotStream]);
collection.push(bananaStream);

collection.collect(function() {
  // All streams have finished writing! yay!
});