http-browserify icon indicating copy to clipboard operation
http-browserify copied to clipboard

Return Buffer objects from requests where it makes sense

Open myndzi opened this issue 9 years ago • 5 comments

See: http://stackoverflow.com/questions/30869460/node-js-browserify-error-on-parsing-tar-file/30878794#30878794, https://github.com/substack/stream-browserify/issues/8

It would be nice if this module emitted actual instances of Buffer so that it is compatible with other streams, specifically for .pipe

myndzi avatar Jun 16 '15 23:06 myndzi

+1

feross avatar Jun 16 '15 23:06 feross

I'm actually in the process of writing a replacement for http-browserify with much more compatible stream support. It looks like @substack hasn't had the time to maintain this module, and its behavior is quite different from the native node http module in some important ways.

I should have an initial version on github within a day or two.

jhiesey avatar Jun 16 '15 23:06 jhiesey

+1 (Problem faced. SO question poster.)

tejasshah93 avatar Jun 16 '15 23:06 tejasshah93

@jhiesey Returning Buffer instead of string by default, making responseType optional (and defaulting to binary), and using new streams, would all be amazing changes!

feross avatar Jun 16 '15 23:06 feross

Link to potential http-browserify replacement is here: https://github.com/jhiesey/httpstream (it fixes this issue)

feross avatar Jul 08 '15 16:07 feross