doc: clarify fs.write[Sync]() descriptions by vsemozhetbyt · Pull Request #22402 · nodejs/node

@vsemozhetbyt

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

TimothyGu

benjamingr

@vsemozhetbyt vsemozhetbyt added fast-track

PRs that do not need to wait for 72 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>

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>

This was referenced

Sep 6, 2018