-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Pass options to createReadStream #179
Conversation
# Conflicts: # changelog.md # package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly does the encoding
option do, in what situations would you use it? The underlying Node.js stream.Writable
constructor has a defaultEncoding
option, is it directly related; is that a better name?
- There needs to be a proper JSDoc typedef for the
createReadStream
function and its parameters, with links in the parameter descriptions to relevantfs-capacitor
and/or Node.js docs. - Also, there should be tests ensuring the parameters are passed through and work.
The option descriptions still need to be added. See: #179 (review)
@mike-marcacci I added a |
I 100% agree that this needs tests – the |
Does None of the https://github.com/mike-marcacci/fs-capacitor#createreadstream-readstream
I'm not objecting to adding this feature to the API, I'm just trying to understand what it does so I can quality control the documentation and be sure its naming makes sense. |
Hey @jaydenseric I've updated the docs in fs-capacitor (along with some other small improvements) which are pending release. Can you look over that and see if that helps clear things up? I mostly just referred to the node docs, since these are advanced options of most streams, which are critical if you need them, but typically don't need to be changed from the defaults. If you see anything that should change in the README there I'll get those changes before cutting the release. I'll also try to add tests and docs to this PR tomorrow. |
OK, I added tests and some docs (partly copied from, partly referencing the new docs in The primary use-case for encoding is when someone wants to stream something encoded with variable-byte characters like utf8 and doesn't want to handle a chunk that ends partway through a character. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pulled in master
branch and fixed up the tests, but there is some more work to be done on the documentation as it's currently incorrect.
I'll take it from here.
The option descriptions still need to be added. See: jaydenseric/graphql-upload#179 (review)
I updated fs-capacitor to pass through the stream options
highWaterMark
andencoding
which is now published as version 6. The API of version 5 was identical to version 4, but without support for node versions < 10. Now that the node 8 LTS window is expired (Dec 31st) we can drop support for it here.This fixes #177.