Closed sheerun closed 8 years ago
This appears to be unrelated to get-stream
:
Attempted reproduction:
var http = require('https');
var getStream = require('get-stream');
http.get('https://nodejs.org/dist/v4.4.5/node-v4.4.5-linux-x86.tar.xz')
.on('response', resp => {
getStream(resp).then(data => console.log(`got the data: ${data.length}`));
});
Result:
got the data: 7634317
It also works just fine using got
directly:
var got = require('got');
var getStream = require('./');
var url = 'https://nodejs.org/dist/v4.4.5/node-v4.4.5-linux-x86.tar.xz';
getStream.buffer(got.stream(url))
.then(res => {
console.log('result :' + res.length);
});
@kevva - I'm pretty sure https://github.com/sindresorhus/get-stream/pull/6 is what broke things for the download
package, but moving to flowing mode was a conscious decision. I've looked at your code, and nothing is jumping out at me as wrong.
Yeah, I tried concat-stream
and got the same result so probably not related to this module.
Related: https://github.com/kevva/download/issues/105
How to reproduce: https://github.com/sheerun/async-fail/