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

Add Writable #56

Open
SirkoS opened this issue May 11, 2017 · 3 comments
Open

Add Writable #56

SirkoS opened this issue May 11, 2017 · 3 comments

Comments

@SirkoS
Copy link

SirkoS commented May 11, 2017

Can you please add a proxy for instances of stream.Writable ?
https://nodejs.org/api/stream.html#stream_class_stream_writable

in particular I would be interested in the instances created by fs.createWriteStream()
https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options

@SirkoS SirkoS changed the title Add Write Add Writable May 11, 2017
@RyanZim
Copy link
Contributor

RyanZim commented May 11, 2017

How would mz proxy or improve on stream.Writable?

@SirkoS
Copy link
Author

SirkoS commented May 11, 2017

Both .write() and .end() accept a callback to be notified after the content has been flushed.
I had a use case, where I needed to wait until the stream had finished to proceed. The code would look much cleaner, if I could use await and/or promises.

@jonathanong
Copy link
Contributor

unfortunately, that's a lot harder to do as we would have to create subclasses and extend methods, etc.

also, i generally recommend not interacting with streams directly and use a module that handles streams correctly and robustly

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