Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream: PassThrough? #2

Closed
mattdesl opened this issue Aug 23, 2015 · 5 comments
Closed

Stream: PassThrough? #2

mattdesl opened this issue Aug 23, 2015 · 5 comments

Comments

@mattdesl
Copy link
Owner

Should this be using PassThrough instead of through2? Is there any significant gain?

scottcorgan/tap-out#11
/cc @shinnn

@shinnn
Copy link

shinnn commented Aug 23, 2015

Here is my opinion: scottcorgan/tap-out#11 (comment)

On the other hand, someone still prefer through2 for its simplicity: kevva/vinyl-assign#1 (comment)

kevva/vinyl-assign#1 (comment)

Streams3 has a simplified constructor API (nodejs/readable-stream#102) and we can use it everywhere by using readable-stream v2.0.0. That seems enough simple for me and I think now through2 is almost finishing its roles in the point of simplicity.

kevva/vinyl-assign#1 (comment)

I'm aware, but through2 still have a tiny bit simpler API, so I don't really see the benefit of switching.

@shinnn
Copy link

shinnn commented Aug 23, 2015

Is there any significant gain?

Package file size is slightly different.

$ npm i through2
$ du -sh node_modules/through2
> 364K  node_modules/through2
$ npm i readable-stream
$ du -sh node_modules/readable-stream
> 304K  node_modules/readable-stream

@yoshuawuyts
Copy link
Collaborator

For correctness: shouldn't this be a ReadableStream rather than a TransformStream? We're not taking any input; it's output only. Might save some issues with with the predictability of finish events (.on('finish'|'end')). from2 / from2-string is pretty good for that.

edit: for the record: from2 and friends use readable-stream under the hood 🎉

@mattdesl
Copy link
Owner Author

from2-string seems like a better fit for this module than through2 😄

@shinnn
Copy link

shinnn commented Aug 23, 2015

👍 from2-string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants