Package Exports
- batch-write-stream
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (batch-write-stream) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
batch-write-stream
Write stream that batches all writes done in the same tick.
Install
$ npm install batch-write-stream --save
Use
Require
var BatchWriteStream = require('batch-write-stream');
Create
var stream = BatchWriteStream();
Or, with options:
var options = {
highWaterMark: 100, // default
maxConcurrentBatches: 1 // default
};
var stream = BatchWriteStream(options);
Implement _writeBatch
stream._writeBatch = function(batch, cb) {
// batch is an array
// call cb when done
}
Map
You can map each value before it is written:
stream._map = function(d) {
return transform(d);
};
License
MIT