-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: clarify fs.write[Sync]() descriptions #22402
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. All default values for optional `encoding` parameters were documented except for the one in `fs.write(fd, string...)` method. This PR makes up this deficiency. Refs: https://github.com/nodejs/node/blob/a04f2f7df630427bf869b1e04040975b752973b6/lib/fs.js#L549 2. We have two variants of `fs.write()` / `fs.writeSync()` methods: for buffers and strings. Currently, the sync methods have only one common reference to the full description of async methods. However, the link may seem to belong to the last sync variant only (for strings) and, as it refers to the first async variant (for buffers), this may be confusing. This PR makes two different sync variants refer to two different async variants. 3. In passing, both returned values of sync methods were also made more concise and unambiguous.
nodejs-github-bot
added
doc
Issues and PRs related to the documentations.
fs
Issues and PRs related to the fs subsystem / file system.
labels
Aug 19, 2018
Node.js Collaborators, please, add 👍 here if you approve fast-tracking. |
TimothyGu
approved these changes
Aug 19, 2018
benjamingr
approved these changes
Aug 19, 2018
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.
Changes LGTM. Thanks for all the amazing doc work you've been putting in! 🎉
vsemozhetbyt
added
fast-track
PRs that do not need to wait for 48 hours to land.
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
labels
Aug 19, 2018
lpinca
approved these changes
Aug 19, 2018
vsemozhetbyt
added a commit
that referenced
this pull request
Aug 19, 2018
1. All default values for optional `encoding` parameters were documented except for the one in `fs.write(fd, string...)` method. This PR makes up this deficiency. 2. We have two variants of `fs.write()` / `fs.writeSync()` methods: for buffers and strings. Currently, the sync methods have only one common reference to the full description of async methods. However, the link may seem to belong to the last sync variant only (for strings) and, as it refers to the first async variant (for buffers), this may be confusing. This PR makes two different sync variants refer to two different async variants. 3. In passing, both returned values of sync methods were also made more concise and unambiguous. PR-URL: #22402 Refs: https://github.com/nodejs/node/blob/a04f2f7df630427bf869b1e04040975b752973b6/lib/fs.js#L549 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Landed in 7108893 Thank you for the reviews. And for the kind words) |
targos
pushed a commit
that referenced
this pull request
Aug 21, 2018
1. All default values for optional `encoding` parameters were documented except for the one in `fs.write(fd, string...)` method. This PR makes up this deficiency. 2. We have two variants of `fs.write()` / `fs.writeSync()` methods: for buffers and strings. Currently, the sync methods have only one common reference to the full description of async methods. However, the link may seem to belong to the last sync variant only (for strings) and, as it refers to the first async variant (for buffers), this may be confusing. This PR makes two different sync variants refer to two different async variants. 3. In passing, both returned values of sync methods were also made more concise and unambiguous. PR-URL: #22402 Refs: https://github.com/nodejs/node/blob/a04f2f7df630427bf869b1e04040975b752973b6/lib/fs.js#L549 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
targos
pushed a commit
that referenced
this pull request
Sep 3, 2018
1. All default values for optional `encoding` parameters were documented except for the one in `fs.write(fd, string...)` method. This PR makes up this deficiency. 2. We have two variants of `fs.write()` / `fs.writeSync()` methods: for buffers and strings. Currently, the sync methods have only one common reference to the full description of async methods. However, the link may seem to belong to the last sync variant only (for strings) and, as it refers to the first async variant (for buffers), this may be confusing. This PR makes two different sync variants refer to two different async variants. 3. In passing, both returned values of sync methods were also made more concise and unambiguous. PR-URL: #22402 Refs: https://github.com/nodejs/node/blob/a04f2f7df630427bf869b1e04040975b752973b6/lib/fs.js#L549 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
This was referenced Sep 6, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
doc
Issues and PRs related to the documentations.
fast-track
PRs that do not need to wait for 48 hours to land.
fs
Issues and PRs related to the fs subsystem / file system.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAll default values for optional
encoding
parameters were documented except for the one infs.write(fd, string...)
method. This PR makes up this deficiency.Refs:
node/lib/fs.js
Line 549 in a04f2f7
We have two variants of
fs.write()
/fs.writeSync()
methods: for buffers and strings. Currently, the sync methods have only one common reference to the full description of async methods. However, the link may seem to belong to the last sync variant only (for strings) and, as it refers to the first async variant (for buffers), this may be confusing. This PR makes two different sync variants refer to two different async variants.In passing, both returned values of sync methods were also made more concise and unambiguous.