DEV Community

Discussion on: Node.js 101 - Streams

Collapse
 
micalevisk profile image
Micael Levi L. C.

Streams are great and all but error handling is complex with it.
I've learned with this great talk by Matteo Collina that fs.createReadStream('data.txt').pipe(res) isn't the right way to stream a file over HTTP because this will create a memory leak. Here Matteo explains why.