Skip to content

Commit c897815

Browse files
vsemozhetbytgibfahn
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 Backport-PR-URL: #19753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 333d7dd commit c897815

33 files changed

+264
-264
lines changed

doc/api/addons.md

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

107107
```json

doc/api/async_hooks.md

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

doc/api/buffer.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ changes:
449449
450450
* `size` {integer} The desired length of the new `Buffer`.
451451

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

@@ -535,7 +535,7 @@ const buf = Buffer.alloc(5);
535535
console.log(buf);
536536
```
537537

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

@@ -580,7 +580,7 @@ changes:
580580

581581
* `size` {integer} The desired length of the new `Buffer`.
582582

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

@@ -626,7 +626,7 @@ added: v5.12.0
626626

627627
* `size` {integer} The desired length of the new `Buffer`.
628628

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

@@ -2660,7 +2660,7 @@ deprecated: v6.0.0
26602660
26612661
* `size` {integer} The desired length of the new `SlowBuffer`.
26622662

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

doc/api/child_process.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ the event loop until the spawned process either exits or is terminated.
3838

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

4444
* [`child_process.exec()`][]: spawns a shell and runs a command within that shell,
@@ -143,8 +143,8 @@ changes:
143143
[Shell Requirements][] and [Default Windows Shell][].
144144
* `timeout` {number} **Default:** `0`
145145
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
146-
stderr. **Default:** `200*1024`. If exceeded, the child process is terminated.
147-
See caveat at [`maxBuffer` and Unicode][].
146+
stderr. **Default:** `200 * 1024`. If exceeded, the child process is
147+
terminated. See caveat at [`maxBuffer` and Unicode][].
148148
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
149149
* `uid` {number} Sets the user identity of the process (see setuid(2)).
150150
* `gid` {number} Sets the group identity of the process (see setgid(2)).
@@ -187,7 +187,7 @@ exec('cat *.js bad_file | wc -l', (error, stdout, stderr) => {
187187
```
188188

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

541541
By default, the parent will wait for the detached child to exit. To prevent
542542
the parent from waiting for a given `subprocess`, use the `subprocess.unref()`
@@ -706,8 +706,8 @@ changes:
706706
* `killSignal` {string|integer} The signal value to be used when the spawned
707707
process will be killed. **Default:** `'SIGTERM'`
708708
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
709-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
710-
See caveat at [`maxBuffer` and Unicode][].
709+
stderr. **Default:** `200 * 1024` If exceeded, the child process is
710+
terminated. See caveat at [`maxBuffer` and Unicode][].
711711
* `encoding` {string} The encoding used for all stdio inputs and outputs. **Default:** `'buffer'`
712712
* `windowsHide` {boolean} Hide the subprocess console window that would
713713
normally be created on Windows systems. **Default:** `false`.
@@ -767,8 +767,8 @@ changes:
767767
* `killSignal` {string|integer} The signal value to be used when the spawned
768768
process will be killed. **Default:** `'SIGTERM'`
769769
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
770-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
771-
See caveat at [`maxBuffer` and Unicode][].
770+
stderr. **Default:** `200 * 1024` If exceeded, the child process is
771+
terminated. See caveat at [`maxBuffer` and Unicode][].
772772
* `encoding` {string} The encoding used for all stdio inputs and outputs.
773773
**Default:** `'buffer'`
774774
* `windowsHide` {boolean} Hide the subprocess console window that would
@@ -779,12 +779,12 @@ The `child_process.execSync()` method is generally identical to
779779
[`child_process.exec()`][] with the exception that the method will not return until
780780
the child process has fully closed. When a timeout has been encountered and
781781
`killSignal` is sent, the method won't return until the process has completely
782-
exited. *Note that if the child process intercepts and handles the `SIGTERM`
782+
exited. *Note that if the child process intercepts and handles the `SIGTERM`
783783
signal and doesn't exit, the parent process will wait until the child
784784
process has exited.*
785785

786786
If the process times out or has a non-zero exit code, this method ***will***
787-
throw. The [`Error`][] object will contain the entire result from
787+
throw. The [`Error`][] object will contain the entire result from
788788
[`child_process.spawnSync()`][]
789789

790790
*Note*: Never pass unsanitized user input to this function. Any input
@@ -825,8 +825,8 @@ changes:
825825
* `killSignal` {string|integer} The signal value to be used when the spawned
826826
process will be killed. **Default:** `'SIGTERM'`
827827
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
828-
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
829-
See caveat at [`maxBuffer` and Unicode][].
828+
stderr. **Default:** `200 * 1024` If exceeded, the child process is
829+
terminated. See caveat at [`maxBuffer` and Unicode][].
830830
* `encoding` {string} The encoding used for all stdio inputs and outputs.
831831
**Default:** `'buffer'`
832832
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
@@ -1169,7 +1169,7 @@ properties:
11691169
Defaults to `false`.
11701170

11711171
The optional `callback` is a function that is invoked after the message is
1172-
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
11731173
single argument: `null` on success, or an [`Error`][] object on failure.
11741174

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

doc/api/cli.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ added: v8.0.0
454454

455455
A space-separated list of command line options. `options...` are interpreted as
456456
if they had been specified on the command line before the actual command line
457-
(so they can be overridden). Node will exit with an error if an option that is
457+
(so they can be overridden). Node will exit with an error if an option that is
458458
not allowed in the environment is used, such as `-p` or a script file.
459459

460460
Node options that are allowed are:
@@ -516,7 +516,7 @@ added: v3.0.0
516516

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

521521

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

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

doc/api/cluster.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ Node.js process and a cluster worker differs:
9292
the worker to use the supplied handle, rather than talk to the master
9393
process.
9494
3. `server.listen(0)` Normally, this will cause servers to listen on a
95-
random port. However, in a cluster, each worker will receive the
96-
same "random" port each time they do `listen(0)`. In essence, the
95+
random port. However, in a cluster, each worker will receive 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 @@ objects for 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.
@@ -499,7 +499,7 @@ Emitted after the worker IPC channel has disconnected. This can occur when a
499499
worker exits gracefully, is killed, or is disconnected manually (such as with
500500
worker.disconnect()).
501501

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

@@ -590,7 +590,7 @@ The `addressType` is one of:
590590
* `4` (TCPv4)
591591
* `6` (TCPv6)
592592
* `-1` (unix domain socket)
593-
* `"udp4"` or `"udp6"` (UDP v4 or v6)
593+
* `'udp4'` or `'udp6'` (UDP v4 or v6)
594594

595595
## Event: 'message'
596596
<!-- YAML
@@ -725,7 +725,7 @@ distribute IOCP handles without incurring a large performance hit.
725725

726726
`cluster.schedulingPolicy` can also be set through the
727727
`NODE_CLUSTER_SCHED_POLICY` environment variable. Valid
728-
values are `"rr"` and `"none"`.
728+
values are `'rr'` and `'none'`.
729729

730730
## cluster.settings
731731
<!-- 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

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Updates the cipher with `data`. If the `inputEncoding` argument is given,
244244
its value must be one of `'utf8'`, `'ascii'`, or `'latin1'` and the `data`
245245
argument is a string using the specified encoding. If the `inputEncoding`
246246
argument is not given, `data` must be a [`Buffer`][], `TypedArray`, or
247-
`DataView`. If `data` is a [`Buffer`][], `TypedArray`, or `DataView`, then
247+
`DataView`. If `data` is a [`Buffer`][], `TypedArray`, or `DataView`, then
248248
`inputEncoding` is ignored.
249249

250250
The `outputEncoding` specifies the output format of the enciphered
@@ -495,7 +495,7 @@ added: v0.5.0
495495
- `encoding` {string}
496496

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

501501
### diffieHellman.getPrime([encoding])

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

0 commit comments

Comments
 (0)