tax_collector

Collect the contents of a stream

Tax Collector

Collects all of the data on a stream and emits 'ready' when stream is finished

var TaxCollector = require('tax_collector');
 
var stream = getSomeReadableStream();
 
var collector = new TaxCollector(stream);
 
collector.on('ready', function(text) {
  // Do something with text 
});
  • 'error' event from stream is delegated
  • encoding is set to utf8 by default, but options can be passed with an 'encoding' key