Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A read/write stream that collects data
JavaScript
Tree: feea5aaa9d

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package.json

README.md

data-collector-stream

A read/write stream that collects data

var Stream = require('stream'),
  fs = require('fs'),
  Collector = require('./streams/collector');

var collector = new Collector();
fs.createReadStream('./large-file.txt').pipe(collector);
collector.on('end', function() {
    console.log(collector.getBytesWritten());
    console.log(collector.getData());
});
Something went wrong with that request. Please try again.