rvagg / through2

Tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise
MIT License
1.9k stars 106 forks source link

Add data to end callback #49

Closed erf closed 9 years ago

erf commented 9 years ago

Is there a reason you don't allow writing data to the flush callback, like with the transform callback?

rvagg commented 9 years ago

you'll have to question this upstream @ https://github.com/nodejs/readable-stream as we're only implementing the streams2/3 mechanism

if you did add data on the flush callback, would that mean that you'd need another flush callback because it only gets flushed after that last chunk of data gets pushed through? where does this end?

dwelle commented 7 years ago

Just in case someone reads this, the aforementioned behavior is already implemented in latest readable-stream. Make sure you bump to latest though2 (2.0.3).

https://github.com/nodejs/readable-stream/issues/271