Skip to content

Commit 4d67369

Browse files
vsemozhetbytMylesBorins
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. Backport-PR-URL: #19761 PR-URL: #19743 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 18acad3 commit 4d67369

30 files changed

+228
-227
lines changed

doc/api/addons.md

Lines changed: 1 addition & 1 deletion
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 your 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/buffer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ deprecated: v6.0.0
395395
396396
* `size` {integer} The desired length of the new `Buffer`.
397397

398-
Allocates a new `Buffer` of `size` bytes. The `size` must be less than or equal
398+
Allocates a new `Buffer` of `size` bytes. The `size` must be less than or equal
399399
to the value of [`buffer.kMaxLength`]. Otherwise, a [`RangeError`] is thrown.
400400
A zero-length `Buffer` will be created if `size <= 0`.
401401

doc/api/child_process.md

Lines changed: 9 additions & 8 deletions
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,
@@ -140,7 +140,8 @@ added: v0.1.90
140140
command line parsing should be compatible with `cmd.exe`.
141141
* `timeout` {number} **Default:** `0`
142142
* [`maxBuffer`][] {number} Largest amount of data (in bytes) allowed on
143-
stdout or stderr - if exceeded child process is killed. **Default:** `200*1024`
143+
stdout or stderr - if exceeded child process is killed.
144+
**Default:** `200 * 1024`.
144145
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
145146
* `uid` {number} Sets the user identity of the process (see setuid(2)).
146147
* `gid` {number} Sets the group identity of the process (see setgid(2)).
@@ -170,7 +171,7 @@ exec('cat *.js bad_file | wc -l', (error, stdout, stderr) => {
170171
```
171172

172173
If a `callback` function is provided, it is called with the arguments
173-
`(error, stdout, stderr)`. On success, `error` will be `null`. On error,
174+
`(error, stdout, stderr)`. On success, `error` will be `null`. On error,
174175
`error` will be an instance of [`Error`][]. The `error.code` property will be
175176
the exit code of the child process while `error.signal` will be set to the
176177
signal that terminated the process. Any exit code other than `0` is considered
@@ -218,7 +219,7 @@ added: v0.1.91
218219
* `timeout` {number} **Default:** `0`
219220
* [`maxBuffer`][] {number} Largest amount of data (in bytes) allowed on
220221
stdout or stderr - if exceeded child process is killed.
221-
**Default:**: `200*1024`
222+
**Default:** `200 * 1024`.
222223
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
223224
* `uid` {number} Sets the user identity of the process (see setuid(2)).
224225
* `gid` {number} Sets the group identity of the process (see setgid(2)).
@@ -446,7 +447,7 @@ disabled*.
446447
On non-Windows platforms, if `options.detached` is set to `true`, the child
447448
process will be made the leader of a new process group and session. Note that
448449
child processes may continue running after the parent exits regardless of
449-
whether they are detached or not. See setsid(2) for more information.
450+
whether they are detached or not. See setsid(2) for more information.
450451

451452
By default, the parent will wait for the detached child to exit. To prevent
452453
the parent from waiting for a given `subprocess`, use the `subprocess.unref()`
@@ -656,12 +657,12 @@ The `child_process.execSync()` method is generally identical to
656657
[`child_process.exec()`][] with the exception that the method will not return until
657658
the child process has fully closed. When a timeout has been encountered and
658659
`killSignal` is sent, the method won't return until the process has completely
659-
exited. *Note that if the child process intercepts and handles the `SIGTERM`
660+
exited. *Note that if the child process intercepts and handles the `SIGTERM`
660661
signal and doesn't exit, the parent process will wait until the child
661662
process has exited.*
662663

663664
If the process times out, or has a non-zero exit code, this method ***will***
664-
throw. The [`Error`][] object will contain the entire result from
665+
throw. The [`Error`][] object will contain the entire result from
665666
[`child_process.spawnSync()`][]
666667

667668
**Note: Never pass unsanitised user input to this function. Any input
@@ -997,7 +998,7 @@ properties:
997998
Defaults to `false`.
998999

9991000
The optional `callback` is a function that is invoked after the message is
1000-
sent but before the child may have received it. The function is called with a
1001+
sent but before the child may have received it. The function is called with a
10011002
single argument: `null` on success, or an [`Error`][] object on failure.
10021003

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

doc/api/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ added: v6.12.0
342342
-->
343343

344344
`options...` are interpreted as if they had been specified on the command line
345-
before the actual command line (so they can be overriden). Node will exit with
345+
before the actual command line (so they can be overriden). Node will exit with
346346
an error if an option that is not allowed in the environment is used, such as
347347
`-p` or a script file.
348348

@@ -382,7 +382,7 @@ added: v3.0.0
382382

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

387387

388388
### `NODE_TTY_UNSAFE_ASYNC=1`

doc/api/cluster.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,26 @@ Node.js process and a cluster worker differs:
9090
idea of what the number 7 file descriptor references.
9191
2. `server.listen(handle)` Listening on handles explicitly will cause
9292
the worker to use the supplied handle, rather than talk to the master
93-
process. If the worker already has the handle, then it's presumed
93+
process. If the worker already has the handle, then it's presumed
9494
that you know what you are doing.
9595
3. `server.listen(0)` Normally, this will cause servers to listen on a
96-
random port. However, in a cluster, each worker will receive the
97-
same "random" port each time they do `listen(0)`. In essence, the
98-
port is random the first time, but predictable thereafter. If you
96+
random port. However, in a cluster, each worker will receive the
97+
same "random" port each time they do `listen(0)`. In essence, the
98+
port is random the first time, but predictable thereafter. If you
9999
want to listen on a unique port, generate a port number based on the
100100
cluster worker ID.
101101

102102
There is no routing logic in Node.js, or in your program, and no shared
103-
state between the workers. Therefore, it is important to design your
103+
state between the workers. Therefore, it is important to design your
104104
program such that it does not rely too heavily on in-memory data objects
105105
for things like sessions and login.
106106

107107
Because workers are all separate processes, they can be killed or
108108
re-spawned depending on your program's needs, without affecting other
109-
workers. As long as there are some workers still alive, the server will
110-
continue to accept connections. If no workers are alive, existing connections
111-
will be dropped and new connections will be refused. Node.js does not
112-
automatically manage the number of workers for you, however. It is your
109+
workers. As long as there are some workers still alive, the server will
110+
continue to accept connections. If no workers are alive, existing connections
111+
will be dropped and new connections will be refused. Node.js does not
112+
automatically manage the number of workers for you, however. It is your
113113
responsibility to manage the worker pool for your application's needs.
114114

115115
Although a primary use case for the `cluster` module is networking, it can
@@ -489,7 +489,7 @@ Emitted after the worker IPC channel has disconnected. This can occur when a
489489
worker exits gracefully, is killed, or is disconnected manually (such as with
490490
worker.disconnect()).
491491

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

@@ -582,7 +582,7 @@ The `addressType` is one of:
582582
* `4` (TCPv4)
583583
* `6` (TCPv6)
584584
* `-1` (unix domain socket)
585-
* `"udp4"` or `"udp6"` (UDP v4 or v6)
585+
* `'udp4'` or `'udp6'` (UDP v4 or v6)
586586

587587
## Event: 'message'
588588

@@ -709,7 +709,7 @@ distribute IOCP handles without incurring a large performance hit.
709709

710710
`cluster.schedulingPolicy` can also be set through the
711711
`NODE_CLUSTER_SCHED_POLICY` environment variable. Valid
712-
values are `"rr"` and `"none"`.
712+
values are `'rr'` and `'none'`.
713713

714714
## cluster.settings
715715
<!-- YAML

doc/api/console.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ added: v0.5.0
452452
-->
453453

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

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

doc/api/debugger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ debug> repl
6868
Press Ctrl + C to leave debug repl
6969
> x
7070
5
71-
> 2+2
71+
> 2 + 2
7272
4
7373
debug> next
7474
break in /home/indutny/Code/git/indutny/myscript.js:5

doc/api/dns.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ will contain an array of IPv4 addresses (e.g.
212212
* `options` {Object}
213213
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
214214
The callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects
215-
rather than an array of strings. The TTL is expressed in seconds.
215+
rather than an array of strings. The TTL is expressed in seconds.
216216
* `callback` {Function} An `(err, result)` callback function.
217217

218218
## dns.resolve6(hostname[, options], callback)
@@ -228,7 +228,7 @@ will contain an array of IPv6 addresses.
228228
* `options` {Object}
229229
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
230230
The callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }`
231-
objects rather than an array of strings. The TTL is expressed in seconds.
231+
objects rather than an array of strings. The TTL is expressed in seconds.
232232
* `callback` {Function} An `(err, result)` callback function.
233233

234234
## dns.resolveCname(hostname, callback)
@@ -258,7 +258,7 @@ added: v0.9.12
258258

259259
Uses the DNS protocol to resolve regular expression based records (`NAPTR`
260260
records) for the `hostname`. The `callback` function has arguments
261-
`(err, addresses)`. The `addresses` argument passed to the `callback` function
261+
`(err, addresses)`. The `addresses` argument passed to the `callback` function
262262
will contain an array of objects with the following properties:
263263

264264
* `flags`

doc/api/documentation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ using the `tools/doc/generate.js` program. An HTML template is located at
2626
<!--type=misc-->
2727

2828
Throughout the documentation, you will see indications of a section's
29-
stability. The Node.js API is still somewhat changing, and as it
30-
matures, certain parts are more reliable than others. Some are so
29+
stability. The Node.js API is still somewhat changing, and as it
30+
matures, certain parts are more reliable than others. Some are so
3131
proven, and so relied upon, that they are unlikely to ever change at
32-
all. Others are brand new and experimental, or known to be hazardous
32+
all. Others are brand new and experimental, or known to be hazardous
3333
and in the process of being redesigned.
3434

3535
The stability indices are as follows:

0 commit comments

Comments
 (0)