I recently upgraded to the latest version of Node.js (1.10 ~) from 0.8 ~, and I get a message at startup that says:
util.pump() is deprecated. Use readableStream.pipe() instead.
I tried to switch my functions to say readableStream.pipe (), but I don't think it works the same.
So, I have three questions:
- Why is util.pump out of date?
- How to switch to readableStream.pipe ()? OR 3. How to disable this warning?
Here is the code where I use it (with a 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 point me in the right direction?
source share