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

options documentation #2

Closed
binki opened this issue Nov 25, 2016 · 3 comments
Closed

options documentation #2

binki opened this issue Nov 25, 2016 · 3 comments

Comments

@binki
Copy link

binki commented Nov 25, 2016

When reading the README, it isn’t clear that options is passed through to streams.Writable. I had to read the source code to figure that out and it didn’t seem right.

It’d be great if the documentation could be updated to show how to use array mode because you have to pass in {objectMode: true, } to get it to work—and to be able to do that you have to first know that options is passed through to Writable ;-).

@binki
Copy link
Author

binki commented Nov 25, 2016

s/it didn’t seem right/it seems like I shouldn’t have to read the source code to figure out how to use a module/

;-)

@jeffbski
Copy link
Owner

@binki thanks for reporting about the documentation not being clear. I added a few comments to clarify that the options is passed through to the writeable stream constructor and linked to the Node.js docs for the details. I also gave a specific example to show how to use an object stream array.

I assume in your case you were wanting to get an array of objects so yes, you would use the objectMode: true as you indicated.

Note that it is also valid to use the array mode with a string or binary stream too, it will just be an array of strings or buffers. That's partially the reason why I didn't specify that you have to use objectMode: true since it depends on the context of what you are doing.

I do agree that it is good to show the popular use cases like using for an object stream just to make it clear for people.

I appreciate you taking the time to provide feedback so I could improve the docs so this will help others that come later. v0.3.7 has the latest update to the README.

@binki
Copy link
Author

binki commented Nov 27, 2016

Thanks! It looks great!

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

2 participants