mafintosh / streamx

An iteration of the Node.js core streams with a series of improvements.
MIT License
226 stars 16 forks source link

Handling pipe option to keep writer open #86

Open steverep opened 7 months ago

steverep commented 7 months ago

The streamx implementation for the pipe() method takes a callback as the 2nd parameter, whereas the native Node pipe() takes an options object. Currently the only option is to possibly keep the destination writer open.

I got burned on the upgrade from Gulp v4 to v5 (which now uses streamx) because streamx seems to simply silently ignore the parameter if { end: false } is passed.

As a fix, it would be helpful if streamx threw an error unless a proper callback was passed as the 2nd parameter to avoid such issues.

And as a feature, it would be nice if streamx supported an option to keep the destination open.

mafintosh commented 7 months ago

Not gonna support end: false as thats a massive footgun, but totally fine to throw if someone does it