3 ms·
If you add a listener for 'data', or call stream.resume() then it'll start flowing data as it receives it, just like v0.8 and before. The only caveat is that l
by IsaacSchlueter 14y ago
If you add a listener for 'data', or call stream.resume() then it'll start flowing data as it receives it, just like v0.8 and before. The only caveat is that listening for 'end' will not automatically start the flow of data, so you do sometimes have to either call resume() or add a data listener.
In practice, it's rare that you care about the end of the stream, but not about the data coming through it, except in tests.
tl;dr Your existing programs will almost certainly Just Work.
- mjs 14y agoThanks. Is there any significant performance difference? (I'm wondering if it makes sense to roll my own "proxy" converting read()s to emit()s.)
- IsaacSchlueter 14y agoNo, it does not make sense to roll your own proxy turning read() calls into emits. You probably won't get it to go faster than it does now. Whether you use on('data') or read(), you get equivalent performance.