-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Given in the readme section
Gets the length of the stream automatically if you're using the request or http module. You can also pass the length on initiation. Progress-stream will also check to see if the stream already has a length property.
I tried this example in the readme and length was 0(default value) not the length of the stream.
var progress = require('progress-stream');
var req = require('request');
var fs = require('fs');
var str = progress({
time: 1000
});
str.on('progress', function (progress) {
console.log(Math.round(progress.percentage) + '%');
});
req('http://cachefly.cachefly.net/100mb.test', { headers: { 'user-agent': 'test' } })
.pipe(str)
.pipe(fs.createWriteStream('test.data'));riophae, onikienko, harlentan, vibhor1997a, ivanjx and 4 more
Metadata
Metadata
Assignees
Labels
No labels