I need a nodejs stream (http://nodejs.org/api/stream.html) implementation that sends data to a string. Do you know anyone?
To be direct I’m trying to pipe a request response like this:
request(‘http://google.com/doodle.png’).pipe(fs.createWriteStream(‘doodle.png’))
FROM https://github.com/mikeal/request
Thanks
You might find the class
Sinkin thepipettemodule to be handy for this use case. Using that you can write:Sinkalso handles error events coming back from the stream reasonably gracefully. See https://github.com/Obvious/pipette#sink for details.[Edit: because I realized I used the wrong event name.]