- Current implementation is known as streams2.
- Introduced in node v0.10.
- "suck" streams instead of "spew" streams.
- Instead of
dataevents spewing, call
read()to pull data from source.
- When there isn't any data to consume, then
read()will return undefined.
- Adding a
dataevent 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 call
read()to consume it. This requires you to handle backpressure problems manually.
pipemethod helps write less code and handles back-pressure.
- If you add an
endlistener and don't ever
pipe(), it'll never emit