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

doc: clarify fs.write[Sync]() descriptions #22402

Closed
wants to merge 1 commit into from
Closed

doc: clarify fs.write[Sync]() descriptions #22402

wants to merge 1 commit into from

Conversation

vsemozhetbyt
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
  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:

    node/lib/fs.js

    Line 549 in a04f2f7

    length = 'utf8';

  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.

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 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
@vsemozhetbyt
Copy link
Contributor Author

Node.js Collaborators, please, add 👍 here if you approve fast-tracking.

Copy link
Member

@benjamingr benjamingr left a 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 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
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 <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@vsemozhetbyt
Copy link
Contributor Author

Landed in 7108893

Thank you for the reviews. And for the kind words)

@vsemozhetbyt vsemozhetbyt deleted the doc-fs-write-sync-links branch August 19, 2018 19:01
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 <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants