-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments
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/ ;-) |
@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. |
Thanks! It looks great! |
When reading the README, it isn’t clear that
options
is passed through tostreams.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 thatoptions
is passed through toWritable
;-).The text was updated successfully, but these errors were encountered: