I recently updated to the latest version of Node.js (1.10~) from 0.8~, and I've been getting a message when running that says:
util.pump() is deprecated. Use readableStream.pipe() instead.
I've tried to switch my functions to say readableStream.pipe(), but I don't think it's working the same.
So I have three questions:
Here is the code where I'm using it (with mustache)
var stream = mu.compileAndRender(template_file, json_object_from_db);
util.pump(stream, res);
When I replace util.pump with readableStream.pipe, I get this error:
ReferenceError: readableStream is not defined
Can anyone help point me in the right direction?
Okay, so this question was a pretty easy answer after some more experimentation (though documentation was null).
Basically, readableStream is just a variable you're supposed to replace with your stream. So in my case, the answer is:
stream.pipe(res);
You just replace util, basically, with the stream. Easy peezy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With