From Node API Stream Docs about stream.pipeline()
:
- A module method to pipe between streams and generators forwarding errors and properly cleaning up and provide a callback when the pipeline is complete.
- It closes all the streams when an error is raised.
- It leaves dangling event listeners on the streams after the callback has been invoked. In the case of reuse of streams after failure, this can cause event listener leaks and swallowed errors. If the last stream is readable, dangling event listeners will be removed so that the last stream can be consumed later.
- Visit
chrome://inspect/#devices
on Google Chrome and chooseinspect
under{filename}.js
Target. - Go on
Memory
tab, selectHeap snapshot
and take a snapshot by clicking theTake Snapshot
button. - Visit
localhost:3000
and again take a snapshot by visitingProfile
section. - Compare results between the snapshots by the drop-down menu
All objects
->Objects allocated between Snapshot 1 and Snapshot 2
.
node --inspect pipe.js
node --inspect pipeline.js