Skip to content

Commit ae86adc

Browse files
vsemozhetbyttargos
authored andcommitted
doc: fix various nits
* Replace 2 hyphens (--) by spaced m-dashes (—) as per STYLE_GUIDE.md. * Space infix operators. * Unify quotes in inline code spans (use only single quotes). * Unify `* Returns:` (eliminate deviations). * Dedupe spaces. PR-URL: #19743 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 0bd78dc commit ae86adc

34 files changed

+268
-267
lines changed

doc/api/addons.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Addon module name is `addon`.
102102
Once the source code has been written, it must be compiled into the binary
103103
`addon.node` file. To do so, create a file called `binding.gyp` in the
104104
top-level of the project describing the build configuration of the module
105-
using a JSON-like format. This file is used by [node-gyp][] -- a tool written
105+
using a JSON-like format. This file is used by [node-gyp][] a tool written
106106
specifically to compile Node.js Addons.
107107

108108
```json

doc/api/async_hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ asyncResource.emitAfter();
636636
* `type` {string} The type of async event.
637637
* `options` {Object}
638638
* `triggerAsyncId` {number} The ID of the execution context that created this
639-
async event. **Default:** `executionAsyncId()`
639+
async event. **Default:** `executionAsyncId()`.
640640
* `requireManualDestroy` {boolean} Disables automatic `emitDestroy` when the
641641
object is garbage collected. This usually does not need to be set (even if
642642
`emitDestroy` is called manually), unless the resource's asyncId is retrieved

doc/api/buffer.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ differently based on what arguments are provided:
5959
entire `Buffer`. While this behavior is *intentional* to improve performance,
6060
development experience has demonstrated that a more explicit distinction is
6161
required between creating a fast-but-uninitialized `Buffer` versus creating a
62-
slower-but-safer `Buffer`. Starting in Node.js 8.0.0, `Buffer(num)` and
62+
slower-but-safer `Buffer`. Starting in Node.js 8.0.0, `Buffer(num)` and
6363
`new Buffer(num)` will return a `Buffer` with initialized memory.
6464
* Passing a string, array, or `Buffer` as the first argument copies the
6565
passed object's data into the `Buffer`.
@@ -426,7 +426,7 @@ changes:
426426
427427
* `size` {integer} The desired length of the new `Buffer`.
428428

429-
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
429+
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
430430
[`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be
431431
thrown. A zero-length `Buffer` will be created if `size` is 0.
432432

@@ -502,7 +502,7 @@ console.log(buf);
502502
// Prints: <Buffer 00 00 00 00 00>
503503
```
504504

505-
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
505+
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
506506
[`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be
507507
thrown. A zero-length `Buffer` will be created if `size` is 0.
508508

@@ -543,7 +543,7 @@ changes:
543543

544544
* `size` {integer} The desired length of the new `Buffer`.
545545

546-
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
546+
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
547547
[`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be
548548
thrown. A zero-length `Buffer` will be created if `size` is 0.
549549

@@ -587,7 +587,7 @@ added: v5.12.0
587587

588588
* `size` {integer} The desired length of the new `Buffer`.
589589

590-
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
590+
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
591591
[`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be
592592
thrown. A zero-length `Buffer` will be created if `size` is 0.
593593

@@ -2458,7 +2458,7 @@ deprecated: v6.0.0
24582458
24592459
* `size` {integer} The desired length of the new `SlowBuffer`.
24602460

2461-
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
2461+
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
24622462
[`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be
24632463
thrown. A zero-length `Buffer` will be created if `size` is 0.
24642464

doc/api/child_process.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ the event loop until the spawned process either exits or is terminated.
4141

4242
For convenience, the `child_process` module provides a handful of synchronous
4343
and asynchronous alternatives to [`child_process.spawn()`][] and
44-
[`child_process.spawnSync()`][]. *Note that each of these alternatives are
44+
[`child_process.spawnSync()`][]. *Note that each of these alternatives are
4545
implemented on top of [`child_process.spawn()`][] or [`child_process.spawnSync()`][].*
4646

4747
* [`child_process.exec()`][]: spawns a shell and runs a command within that shell,
@@ -146,8 +146,8 @@ changes:
146146
[Shell Requirements][] and [Default Windows Shell][].
147147
* `timeout` {number} **Default:** `0`
148148
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
149-
stderr. **Default:** `200*1024`. If exceeded, the child process is terminated.
150-
See caveat at [`maxBuffer` and Unicode][].
149+
stderr. If exceeded, the child process is terminated. See caveat at
150+
[`maxBuffer` and Unicode][]. **Default:** `200 * 1024`.
151151
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
152152
* `uid` {number} Sets the user identity of the process (see setuid(2)).
153153
* `gid` {number} Sets the group identity of the process (see setgid(2)).
@@ -189,7 +189,7 @@ exec('cat *.js bad_file | wc -l', (error, stdout, stderr) => {
189189
```
190190

191191
If a `callback` function is provided, it is called with the arguments
192-
`(error, stdout, stderr)`. On success, `error` will be `null`. On error,
192+
`(error, stdout, stderr)`. On success, `error` will be `null`. On error,
193193
`error` will be an instance of [`Error`][]. The `error.code` property will be
194194
the exit code of the child process while `error.signal` will be set to the
195195
signal that terminated the process. Any exit code other than `0` is considered
@@ -258,8 +258,8 @@ changes:
258258
* `encoding` {string} **Default:** `'utf8'`
259259
* `timeout` {number} **Default:** `0`
260260
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
261-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
262-
See caveat at [`maxBuffer` and Unicode][].
261+
stderr. If exceeded, the child process is terminated. See caveat at
262+
[`maxBuffer` and Unicode][]. **Default:** `200 * 1024`.
263263
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
264264
* `uid` {number} Sets the user identity of the process (see setuid(2)).
265265
* `gid` {number} Sets the group identity of the process (see setgid(2)).
@@ -538,7 +538,7 @@ disabled*.
538538
On non-Windows platforms, if `options.detached` is set to `true`, the child
539539
process will be made the leader of a new process group and session. Note that
540540
child processes may continue running after the parent exits regardless of
541-
whether they are detached or not. See setsid(2) for more information.
541+
whether they are detached or not. See setsid(2) for more information.
542542

543543
By default, the parent will wait for the detached child to exit. To prevent
544544
the parent from waiting for a given `subprocess`, use the `subprocess.unref()`
@@ -712,9 +712,10 @@ changes:
712712
* `killSignal` {string|integer} The signal value to be used when the spawned
713713
process will be killed. **Default:** `'SIGTERM'`
714714
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
715-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
716-
See caveat at [`maxBuffer` and Unicode][].
717-
* `encoding` {string} The encoding used for all stdio inputs and outputs. **Default:** `'buffer'`
715+
stderr. If exceeded, the child process is terminated. See caveat at
716+
[`maxBuffer` and Unicode][]. **Default:** `200 * 1024`.
717+
* `encoding` {string} The encoding used for all stdio inputs and outputs.
718+
**Default:** `'buffer'`.
718719
* `windowsHide` {boolean} Hide the subprocess console window that would
719720
normally be created on Windows systems. **Default:** `false`.
720721
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
@@ -773,8 +774,8 @@ changes:
773774
* `killSignal` {string|integer} The signal value to be used when the spawned
774775
process will be killed. **Default:** `'SIGTERM'`
775776
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
776-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
777-
See caveat at [`maxBuffer` and Unicode][].
777+
stderr. If exceeded, the child process is terminated. See caveat at
778+
[`maxBuffer` and Unicode][]. **Default:** `200 * 1024`.
778779
* `encoding` {string} The encoding used for all stdio inputs and outputs.
779780
**Default:** `'buffer'`
780781
* `windowsHide` {boolean} Hide the subprocess console window that would
@@ -785,12 +786,12 @@ The `child_process.execSync()` method is generally identical to
785786
[`child_process.exec()`][] with the exception that the method will not return until
786787
the child process has fully closed. When a timeout has been encountered and
787788
`killSignal` is sent, the method won't return until the process has completely
788-
exited. *Note that if the child process intercepts and handles the `SIGTERM`
789+
exited. *Note that if the child process intercepts and handles the `SIGTERM`
789790
signal and doesn't exit, the parent process will wait until the child
790791
process has exited.*
791792

792793
If the process times out or has a non-zero exit code, this method ***will***
793-
throw. The [`Error`][] object will contain the entire result from
794+
throw. The [`Error`][] object will contain the entire result from
794795
[`child_process.spawnSync()`][]
795796

796797
**Never pass unsanitized user input to this function. Any input containing shell
@@ -830,8 +831,8 @@ changes:
830831
* `killSignal` {string|integer} The signal value to be used when the spawned
831832
process will be killed. **Default:** `'SIGTERM'`
832833
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
833-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
834-
See caveat at [`maxBuffer` and Unicode][].
834+
stderr. If exceeded, the child process is terminated. See caveat at
835+
[`maxBuffer` and Unicode][]. **Default:** `200 * 1024`.
835836
* `encoding` {string} The encoding used for all stdio inputs and outputs.
836837
**Default:** `'buffer'`
837838
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
@@ -1168,7 +1169,7 @@ properties:
11681169
Defaults to `false`.
11691170

11701171
The optional `callback` is a function that is invoked after the message is
1171-
sent but before the child may have received it. The function is called with a
1172+
sent but before the child may have received it. The function is called with a
11721173
single argument: `null` on success, or an [`Error`][] object on failure.
11731174

11741175
If no `callback` function is provided and the message cannot be sent, an

doc/api/cli.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ added: v3.0.0
517517

518518
Path to the file used to store the persistent REPL history. The default path is
519519
`~/.node_repl_history`, which is overridden by this variable. Setting the value
520-
to an empty string (`""` or `" "`) disables persistent REPL history.
520+
to an empty string (`''` or `' '`) disables persistent REPL history.
521521

522522

523523
### `NODE_EXTRA_CA_CERTS=file`
@@ -602,7 +602,7 @@ reason any of these APIs takes a long time, other (seemingly unrelated) APIs
602602
that run in libuv's threadpool will experience degraded performance. In order to
603603
mitigate this issue, one potential solution is to increase the size of libuv's
604604
threadpool by setting the `'UV_THREADPOOL_SIZE'` environment variable to a value
605-
greater than `4` (its current default value). For more information, see the
605+
greater than `4` (its current default value). For more information, see the
606606
[libuv threadpool documentation][].
607607

608608
[`--openssl-config`]: #cli_openssl_config_file

doc/api/cluster.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Node.js process and a cluster worker differs:
9393
process.
9494
3. `server.listen(0)` Normally, this will cause servers to listen on a
9595
random port. However, in a cluster, each worker will receive the
96-
same "random" port each time they do `listen(0)`. In essence, the
96+
same "random" port each time they do `listen(0)`. In essence, the
9797
port is random the first time, but predictable thereafter. To listen
9898
on a unique port, generate a port number based on the cluster worker ID.
9999

@@ -103,8 +103,8 @@ things like sessions and login.
103103

104104
Because workers are all separate processes, they can be killed or
105105
re-spawned depending on a program's needs, without affecting other
106-
workers. As long as there are some workers still alive, the server will
107-
continue to accept connections. If no workers are alive, existing connections
106+
workers. As long as there are some workers still alive, the server will
107+
continue to accept connections. If no workers are alive, existing connections
108108
will be dropped and new connections will be refused. Node.js does not
109109
automatically manage the number of workers, however. It is the application's
110110
responsibility to manage the worker pool based on its own needs.
@@ -465,8 +465,8 @@ Emitted after the worker IPC channel has disconnected. This can occur when a
465465
worker exits gracefully, is killed, or is disconnected manually (such as with
466466
worker.disconnect()).
467467

468-
There may be a delay between the `'disconnect'` and `'exit'` events. These
469-
events can be used to detect if the process is stuck in a cleanup or if there
468+
There may be a delay between the `'disconnect'` and `'exit'` events. These
469+
events can be used to detect if the process is stuck in a cleanup or if there
470470
are long-living connections.
471471

472472
```js
@@ -556,7 +556,7 @@ The `addressType` is one of:
556556
* `4` (TCPv4)
557557
* `6` (TCPv6)
558558
* `-1` (unix domain socket)
559-
* `"udp4"` or `"udp6"` (UDP v4 or v6)
559+
* `'udp4'` or `'udp6'` (UDP v4 or v6)
560560

561561
## Event: 'message'
562562
<!-- YAML
@@ -692,7 +692,7 @@ distribute IOCP handles without incurring a large performance hit.
692692

693693
`cluster.schedulingPolicy` can also be set through the
694694
`NODE_CLUSTER_SCHED_POLICY` environment variable. Valid
695-
values are `"rr"` and `"none"`.
695+
values are `'rr'` and `'none'`.
696696

697697
## cluster.settings
698698
<!-- YAML

doc/api/console.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The module exports two specific components:
1212
* A `Console` class with methods such as `console.log()`, `console.error()` and
1313
`console.warn()` that can be used to write to any Node.js stream.
1414
* A global `console` instance configured to write to [`process.stdout`][] and
15-
[`process.stderr`][]. The global `console` can be used without calling
15+
[`process.stderr`][]. The global `console` can be used without calling
1616
`require('console')`.
1717

1818
***Warning***: The global console object's methods are neither consistently

doc/api/crypto.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Updates the cipher with `data`. If the `inputEncoding` argument is given,
301301
its value must be one of `'utf8'`, `'ascii'`, or `'latin1'` and the `data`
302302
argument is a string using the specified encoding. If the `inputEncoding`
303303
argument is not given, `data` must be a [`Buffer`][], `TypedArray`, or
304-
`DataView`. If `data` is a [`Buffer`][], `TypedArray`, or `DataView`, then
304+
`DataView`. If `data` is a [`Buffer`][], `TypedArray`, or `DataView`, then
305305
`inputEncoding` is ignored.
306306

307307
The `outputEncoding` specifies the output format of the enciphered
@@ -552,7 +552,7 @@ added: v0.5.0
552552
- `encoding` {string}
553553

554554
Returns the Diffie-Hellman generator in the specified `encoding`, which can
555-
be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is
555+
be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is
556556
returned; otherwise a [`Buffer`][] is returned.
557557

558558
### diffieHellman.getPrime([encoding])
@@ -1716,8 +1716,8 @@ const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
17161716
console.log(key.toString('hex')); // '3745e48...08d59ae'
17171717
```
17181718

1719-
The `crypto.DEFAULT_ENCODING` may be used to change the way the `derivedKey`
1720-
is returned:
1719+
The `crypto.DEFAULT_ENCODING` property may be used to change the way the
1720+
`derivedKey` is returned.
17211721

17221722
```js
17231723
const crypto = require('crypto');

doc/api/debugger.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ debug> repl
7070
Press Ctrl + C to leave debug repl
7171
> x
7272
5
73-
> 2+2
73+
> 2 + 2
7474
4
7575
debug> next
7676
< world

doc/api/deprecations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,8 @@ Type: Runtime
699699
700700
`Module._debug()` has been deprecated.
701701
702-
The `Module._debug()` function was never documented as an officially supported
703-
API.
702+
The `Module._debug()` function was never documented as an officially
703+
supported API.
704704
705705
<a id="DEP0078"></a>
706706
### DEP0078: REPLServer.turnOffEditorMode()

0 commit comments

Comments
 (0)