progress-stream
Advanced tools
Comparing version 0.1.1 to 0.2.0
var through = require('through2'); | ||
module.exports = function(options) { | ||
module.exports = function(options, onprogress) { | ||
if (typeof options === 'function') return module.exports(null, options); | ||
options = options || {}; | ||
@@ -41,3 +42,3 @@ | ||
var tr = through(write, end); | ||
var tr = through(options.objectMode ? {objectMode:true, highWaterMark:16} : {}, write, end); | ||
var onlength = function(newLength) { | ||
@@ -62,4 +63,5 @@ length = newLength; | ||
if (drain) tr.resume(); | ||
if (onprogress) tr.on('progress', onprogress); | ||
return tr; | ||
}; |
{ | ||
"name": "progress-stream", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Read the progress of a stream", | ||
@@ -5,0 +5,0 @@ "repository": { |
5185
91