The good, the bad and the ugly of nodejs streams
summary
Explains when Node streams actually win: counting spaces in huge files by streaming chunks, copying files via createReadStream/createWriteStream and handling errors and backpressure, and inserting a gzip transform in middle to compress on the fly. Shows custom Readable/Writable/Transform classes and a duplex TCP toy BBS built with two pipelines that works. Compares Web Streams and async iterators and claims pipeline returns a promise and async iterators cost <2% overhead.
AI-written summary · about
chapters (17)
- 0:00Node.js streams intro
- 1:32Why use streams
- 3:04Reading files with streams
- 6:02Copy files with streams
- 7:54Error handling in streams
- 9:40Simplify streams with pipeline
- 10:44Compress files with transform
- 11:47Understanding duplex streams
- 13:15Custom readable streams
- 14:22Custom writable streams
- 15:30Transform streams for data
- 16:15Web streams intro
- 17:43Creating readable web streams
- 18:45Consuming web streams
- 20:35Async iterators explained
- 22:02Async iterators with streams
- 23:55Summary
related talks
33mStream into the Future
34mUnderstanding Streams, Signals and Events in Nodejs
23mComputer Science through Streams
34mStream into the Future
23mAsync Iterators: a new future for streams
34mYou Don't Know Node.js
33mTaking Node.js to The Ex-Stream: Stream to Scale
25mA JavaScript Parody: A Fun Journey through Hot Topics of Node.js and JS
