- Current implementation is known as streams2.
- Introduced in node v0.10.
- "suck" streams instead of "spew" streams.
- Instead of
data
events spewing, callread()
to pull data from source. - When there isn't any data to consume, then
read()
will return undefined. - Adding a
data
event listener will switch the Readable stream into "old mode", where data is emitted as soon as it is available rather than waiting for you to callread()
to consume it. This requires you to handle backpressure problems manually. - The
pipe
method helps write less code and handles back-pressure. - If you add an
end
listener and don't everread()
orpipe()
, it'll never emitend
.
Isaac Z. Presentation
Tim Caswell
Stream Compatibility
Getting Started With Streams2