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/#deviceson Google Chrome and chooseinspectunder{filename}.jsTarget. - Go on
Memorytab, selectHeap snapshotand take a snapshot by clicking theTake Snapshotbutton. - Visit
localhost:3000and again take a snapshot by visitingProfilesection. - Compare results between the snapshots by the drop-down menu
All objects->Objects allocated between Snapshot 1 and Snapshot 2.
node --inspect pipe.jsnode --inspect pipeline.js