Live data from Hacker News

Node.js modules you should know about: request

catonmat.net

1–9 of 9 posts

Re: Node.js modules you should know about: request

#5
post #4

This is one of the modules everyone starts to build themselves, then realizes there's a much better version already built.

Unfortunately I've had the opposite experience: trying to use request then finding that I have to build my own. Mainly because it has no good pattern for both streaming and catching errors in a predictable fashion, the streaming isn't true streaming in most cases (try a 5GB file), and with binary files, it's tricky to nail the right encoding.

Re: Node.js modules you should know about: request

#6
post #5
post #4

This is one of the modules everyone starts to build themselves, then realizes there's a much better version already built.

Unfortunately I've had the opposite experience: trying to use request then finding that I have to build my own. Mainly because it has no good pattern for both streaming and catching errors in a predictable fashion, the streaming isn't true streaming in most cases (try a 5GB file), and with binary files, it's tricky to nail the right encoding.

I agree about the encoding problems, particularly when using buffers. No combination seemed to allow me to download a binary file and then upload. But this was my first few hours with Node so I'm open to correction. In the end I was able to use .pipe which correctly managed the encoding

Re: Node.js modules you should know about: request

#8
post #5
post #4

This is one of the modules everyone starts to build themselves, then realizes there's a much better version already built.

Unfortunately I've had the opposite experience: trying to use request then finding that I have to build my own. Mainly because it has no good pattern for both streaming and catching errors in a predictable fashion, the streaming isn't true streaming in most cases (try a 5GB file), and with binary files, it's tricky to nail the right encoding.

Just to clarify: the sorts of things I'm using an HTTP Get-type library for are atypical and request is fantastic for 95% percentage of uses. And the library I wrote ( https://github.com/developmentseed/node-get ) isn't recommended for use if you aren't me. Though it does a decent job of staying out of your way.