3 ms·
I love the new streams API. A 0.8 based Node project I had had to have a messy, callback-filled ad-hoc flow control system because advisory I/O pauses weren't
by bcoates 13y ago
I love the new streams API. A 0.8 based Node project I had had to have a messy, callback-filled ad-hoc flow control system because advisory I/O pauses weren't enough to give bounded memory usage (in practice, not just in theory) and the general lameness of the old streams meant I minimized their use.
I was able to re-write the I/O pipeline into a handful of Streams2 transforms, I was able to ditch a few hundred lines of ugly code and what's left is vastly less complicated.
I agree with the author that it's kind of lame that objectMode streams appear to be second-class, I guess the Node people think everything should be a raw data pipeline annotated with events for a data channel, like 'npm tar' does? I can't quite wrap my brain around the object-hate.