Skip to content

Commit 45c70a9

Browse files
Trotttargos
authored andcommitted
doc: remove dashes
The use of dashes -- in general, but especially in our docs -- can be problematic. It is used inconsistently and there is always another form of punctuation that is as good or better for the situation. In an effort to reduce the number of variations we use to display the same types of information, remove the various uses of dashes from the documentation. PR-URL: #30101 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4458378 commit 45c70a9

26 files changed

+266
-274
lines changed

doc/api/addons.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ provide an interface between JavaScript running in Node.js and C/C++ libraries.
1111
There are three options for implementing Addons: N-API, nan, or direct
1212
use of internal V8, libuv and Node.js libraries. Unless you need direct
1313
access to functionality which is not exposed by N-API, use N-API.
14-
Refer to the section [C/C++ Addons - N-API](n-api.html)
15-
for more information on N-API.
14+
Refer to [C/C++ Addons with N-API](n-api.html) for more information on N-API.
1615

1716
When not using N-API, implementing Addons is complicated,
1817
involving knowledge of several components and APIs:
@@ -435,8 +434,8 @@ NAPI_MODULE(NODE_GYP_MODULE_NAME, init)
435434
} // namespace demo
436435
```
437436
438-
The functions available and how to use them are documented in the
439-
section titled [C/C++ Addons - N-API](n-api.html).
437+
The functions available and how to use them are documented in
438+
[C/C++ Addons with N-API](n-api.html).
440439
441440
## Addon examples
442441

doc/api/buffer.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -182,28 +182,28 @@ console.log(Buffer.from('fhqwhgads', 'utf16le'));
182182

183183
The character encodings currently supported by Node.js include:
184184

185-
* `'ascii'` - For 7-bit ASCII data only. This encoding is fast and will strip
185+
* `'ascii'`: For 7-bit ASCII data only. This encoding is fast and will strip
186186
the high bit if set.
187187

188-
* `'utf8'` - Multibyte encoded Unicode characters. Many web pages and other
188+
* `'utf8'`: Multibyte encoded Unicode characters. Many web pages and other
189189
document formats use UTF-8.
190190

191-
* `'utf16le'` - 2 or 4 bytes, little-endian encoded Unicode characters.
191+
* `'utf16le'`: 2 or 4 bytes, little-endian encoded Unicode characters.
192192
Surrogate pairs (U+10000 to U+10FFFF) are supported.
193193

194-
* `'ucs2'` - Alias of `'utf16le'`.
194+
* `'ucs2'`: Alias of `'utf16le'`.
195195

196-
* `'base64'` - Base64 encoding. When creating a `Buffer` from a string,
196+
* `'base64'`: Base64 encoding. When creating a `Buffer` from a string,
197197
this encoding will also correctly accept "URL and Filename Safe Alphabet" as
198198
specified in [RFC 4648, Section 5][].
199199

200-
* `'latin1'` - A way of encoding the `Buffer` into a one-byte encoded string
200+
* `'latin1'`: A way of encoding the `Buffer` into a one-byte encoded string
201201
(as defined by the IANA in [RFC 1345][],
202202
page 63, to be the Latin-1 supplement block and C0/C1 control codes).
203203

204-
* `'binary'` - Alias for `'latin1'`.
204+
* `'binary'`: Alias for `'latin1'`.
205205

206-
* `'hex'` - Encode each byte as two hexadecimal characters.
206+
* `'hex'`: Encode each byte as two hexadecimal characters.
207207

208208
Modern Web browsers follow the [WHATWG Encoding Standard][] which aliases
209209
both `'latin1'` and `'ISO-8859-1'` to `'win-1252'`. This means that while doing
@@ -1003,8 +1003,8 @@ The index operator `[index]` can be used to get and set the octet at position
10031003
range is between `0x00` and `0xFF` (hex) or `0` and `255` (decimal).
10041004

10051005
This operator is inherited from `Uint8Array`, so its behavior on out-of-bounds
1006-
access is the same as `UInt8Array` - that is, getting returns `undefined` and
1007-
setting does nothing.
1006+
access is the same as `UInt8Array`. In other words, getting returns `undefined`
1007+
and setting does nothing.
10081008

10091009
```js
10101010
// Copy an ASCII string into a `Buffer` one byte at a time.

doc/api/child_process.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -599,21 +599,21 @@ equal to `['pipe', 'pipe', 'pipe']`.
599599

600600
For convenience, `options.stdio` may be one of the following strings:
601601

602-
* `'pipe'` - equivalent to `['pipe', 'pipe', 'pipe']` (the default)
603-
* `'ignore'` - equivalent to `['ignore', 'ignore', 'ignore']`
604-
* `'inherit'` - equivalent to `['inherit', 'inherit', 'inherit']` or `[0, 1, 2]`
602+
* `'pipe'`: equivalent to `['pipe', 'pipe', 'pipe']` (the default)
603+
* `'ignore'`: equivalent to `['ignore', 'ignore', 'ignore']`
604+
* `'inherit'`: equivalent to `['inherit', 'inherit', 'inherit']` or `[0, 1, 2]`
605605

606606
Otherwise, the value of `options.stdio` is an array where each index corresponds
607607
to an fd in the child. The fds 0, 1, and 2 correspond to stdin, stdout,
608608
and stderr, respectively. Additional fds can be specified to create additional
609609
pipes between the parent and child. The value is one of the following:
610610

611-
1. `'pipe'` - Create a pipe between the child process and the parent process.
611+
1. `'pipe'`: Create a pipe between the child process and the parent process.
612612
The parent end of the pipe is exposed to the parent as a property on the
613613
`child_process` object as [`subprocess.stdio[fd]`][`subprocess.stdio`]. Pipes
614-
created for fds 0 - 2 are also available as [`subprocess.stdin`][],
614+
created for fds 0, 1, and 2 are also available as [`subprocess.stdin`][],
615615
[`subprocess.stdout`][] and [`subprocess.stderr`][], respectively.
616-
2. `'ipc'` - Create an IPC channel for passing messages/file descriptors
616+
2. `'ipc'`: Create an IPC channel for passing messages/file descriptors
617617
between parent and child. A [`ChildProcess`][] may have at most one IPC
618618
stdio file descriptor. Setting this option enables the
619619
[`subprocess.send()`][] method. If the child is a Node.js process, the
@@ -624,25 +624,25 @@ pipes between the parent and child. The value is one of the following:
624624
Accessing the IPC channel fd in any way other than [`process.send()`][]
625625
or using the IPC channel with a child process that is not a Node.js instance
626626
is not supported.
627-
3. `'ignore'` - Instructs Node.js to ignore the fd in the child. While Node.js
628-
will always open fds 0 - 2 for the processes it spawns, setting the fd to
629-
`'ignore'` will cause Node.js to open `/dev/null` and attach it to the
627+
3. `'ignore'`: Instructs Node.js to ignore the fd in the child. While Node.js
628+
will always open fds 0, 1, and 2 for the processes it spawns, setting the fd
629+
to `'ignore'` will cause Node.js to open `/dev/null` and attach it to the
630630
child's fd.
631-
4. `'inherit'` - Pass through the corresponding stdio stream to/from the
631+
4. `'inherit'`: Pass through the corresponding stdio stream to/from the
632632
parent process. In the first three positions, this is equivalent to
633633
`process.stdin`, `process.stdout`, and `process.stderr`, respectively. In
634634
any other position, equivalent to `'ignore'`.
635-
5. {Stream} object - Share a readable or writable stream that refers to a tty,
635+
5. {Stream} object: Share a readable or writable stream that refers to a tty,
636636
file, socket, or a pipe with the child process. The stream's underlying
637637
file descriptor is duplicated in the child process to the fd that
638638
corresponds to the index in the `stdio` array. The stream must have an
639639
underlying descriptor (file streams do not until the `'open'` event has
640640
occurred).
641-
6. Positive integer - The integer value is interpreted as a file descriptor
641+
6. Positive integer: The integer value is interpreted as a file descriptor
642642
that is currently open in the parent process. It is shared with the child
643643
process, similar to how {Stream} objects can be shared. Passing sockets
644644
is not supported on Windows.
645-
7. `null`, `undefined` - Use default value. For stdio fds 0, 1, and 2 (in other
645+
7. `null`, `undefined`: Use default value. For stdio fds 0, 1, and 2 (in other
646646
words, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the
647647
default is `'ignore'`.
648648

doc/api/cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ For example, `--pending-deprecation` is equivalent to `--pending_deprecation`.
3939
added: v8.0.0
4040
-->
4141

42-
Alias for stdin, analogous to the use of - in other command line utilities,
42+
Alias for stdin. Analogous to the use of `-` in other command line utilities,
4343
meaning that the script will be read from stdin, and the rest of the options
4444
are passed to that script.
4545

doc/api/crypto.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1417,15 +1417,15 @@ If `privateKey` is not a [`KeyObject`][], this function behaves as if
14171417
`privateKey` had been passed to [`crypto.createPrivateKey()`][]. If it is an
14181418
object, the following additional properties can be passed:
14191419

1420-
* `padding`: {integer} - Optional padding value for RSA, one of the following:
1420+
* `padding` {integer} Optional padding value for RSA, one of the following:
14211421
* `crypto.constants.RSA_PKCS1_PADDING` (default)
14221422
* `crypto.constants.RSA_PKCS1_PSS_PADDING`
14231423

14241424
`RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function
14251425
used to sign the message as specified in section 3.1 of [RFC 4055][], unless
14261426
an MGF1 hash function has been specified as part of the key in compliance with
14271427
section 3.3 of [RFC 4055][].
1428-
* `saltLength`: {integer} - salt length for when padding is
1428+
* `saltLength` {integer} Salt length for when padding is
14291429
`RSA_PKCS1_PSS_PADDING`. The special value
14301430
`crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest
14311431
size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the
@@ -1526,15 +1526,15 @@ If `object` is not a [`KeyObject`][], this function behaves as if
15261526
`object` had been passed to [`crypto.createPublicKey()`][]. If it is an
15271527
object, the following additional properties can be passed:
15281528

1529-
* `padding`: {integer} - Optional padding value for RSA, one of the following:
1529+
* `padding` {integer} Optional padding value for RSA, one of the following:
15301530
* `crypto.constants.RSA_PKCS1_PADDING` (default)
15311531
* `crypto.constants.RSA_PKCS1_PSS_PADDING`
15321532

15331533
`RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function
15341534
used to verify the message as specified in section 3.1 of [RFC 4055][], unless
15351535
an MGF1 hash function has been specified as part of the key in compliance with
15361536
section 3.3 of [RFC 4055][].
1537-
* `saltLength`: {integer} - salt length for when padding is
1537+
* `saltLength` {integer} Salt length for when padding is
15381538
`RSA_PKCS1_PSS_PADDING`. The special value
15391539
`crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest
15401540
size, `crypto.constants.RSA_PSS_SALTLEN_AUTO` (default) causes it to be
@@ -2891,13 +2891,13 @@ If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
28912891
passed to [`crypto.createPrivateKey()`][]. If it is an object, the following
28922892
additional properties can be passed:
28932893

2894-
* `padding`: {integer} - Optional padding value for RSA, one of the following:
2894+
* `padding` {integer} Optional padding value for RSA, one of the following:
28952895
* `crypto.constants.RSA_PKCS1_PADDING` (default)
28962896
* `crypto.constants.RSA_PKCS1_PSS_PADDING`
28972897

28982898
`RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function
28992899
used to sign the message as specified in section 3.1 of [RFC 4055][].
2900-
* `saltLength`: {integer} - salt length for when padding is
2900+
* `saltLength` {integer} Salt length for when padding is
29012901
`RSA_PKCS1_PSS_PADDING`. The special value
29022902
`crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest
29032903
size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the
@@ -2944,13 +2944,13 @@ If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
29442944
passed to [`crypto.createPublicKey()`][]. If it is an object, the following
29452945
additional properties can be passed:
29462946

2947-
* `padding`: {integer} - Optional padding value for RSA, one of the following:
2947+
* `padding` {integer} Optional padding value for RSA, one of the following:
29482948
* `crypto.constants.RSA_PKCS1_PADDING` (default)
29492949
* `crypto.constants.RSA_PKCS1_PSS_PADDING`
29502950

29512951
`RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function
29522952
used to sign the message as specified in section 3.1 of [RFC 4055][].
2953-
* `saltLength`: {integer} - salt length for when padding is
2953+
* `saltLength` {integer} Salt length for when padding is
29542954
`RSA_PKCS1_PSS_PADDING`. The special value
29552955
`crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest
29562956
size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the

doc/api/debugger.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,21 @@ To begin watching an expression, type `watch('my_expression')`. The command
104104

105105
### Stepping
106106

107-
* `cont`, `c` - Continue execution
108-
* `next`, `n` - Step next
109-
* `step`, `s` - Step in
110-
* `out`, `o` - Step out
111-
* `pause` - Pause running code (like pause button in Developer Tools)
107+
* `cont`, `c`: Continue execution
108+
* `next`, `n`: Step next
109+
* `step`, `s`: Step in
110+
* `out`, `o`: Step out
111+
* `pause`: Pause running code (like pause button in Developer Tools)
112112

113113
### Breakpoints
114114

115-
* `setBreakpoint()`, `sb()` - Set breakpoint on current line
116-
* `setBreakpoint(line)`, `sb(line)` - Set breakpoint on specific line
117-
* `setBreakpoint('fn()')`, `sb(...)` - Set breakpoint on a first statement in
115+
* `setBreakpoint()`, `sb()`: Set breakpoint on current line
116+
* `setBreakpoint(line)`, `sb(line)`: Set breakpoint on specific line
117+
* `setBreakpoint('fn()')`, `sb(...)`: Set breakpoint on a first statement in
118118
functions body
119-
* `setBreakpoint('script.js', 1)`, `sb(...)` - Set breakpoint on first line of
119+
* `setBreakpoint('script.js', 1)`, `sb(...)`: Set breakpoint on first line of
120120
`script.js`
121-
* `clearBreakpoint('script.js', 1)`, `cb(...)` - Clear breakpoint in `script.js`
121+
* `clearBreakpoint('script.js', 1)`, `cb(...)`: Clear breakpoint in `script.js`
122122
on line 1
123123

124124
It is also possible to set a breakpoint in a file (module) that
@@ -147,26 +147,26 @@ debug>
147147

148148
### Information
149149

150-
* `backtrace`, `bt` - Print backtrace of current execution frame
151-
* `list(5)` - List scripts source code with 5 line context (5 lines before and
150+
* `backtrace`, `bt`: Print backtrace of current execution frame
151+
* `list(5)`: List scripts source code with 5 line context (5 lines before and
152152
after)
153-
* `watch(expr)` - Add expression to watch list
154-
* `unwatch(expr)` - Remove expression from watch list
155-
* `watchers` - List all watchers and their values (automatically listed on each
153+
* `watch(expr)`: Add expression to watch list
154+
* `unwatch(expr)`: Remove expression from watch list
155+
* `watchers`: List all watchers and their values (automatically listed on each
156156
breakpoint)
157-
* `repl` - Open debugger's repl for evaluation in debugging script's context
158-
* `exec expr` - Execute an expression in debugging script's context
157+
* `repl`: Open debugger's repl for evaluation in debugging script's context
158+
* `exec expr`: Execute an expression in debugging script's context
159159

160160
### Execution control
161161

162-
* `run` - Run script (automatically runs on debugger's start)
163-
* `restart` - Restart script
164-
* `kill` - Kill script
162+
* `run`: Run script (automatically runs on debugger's start)
163+
* `restart`: Restart script
164+
* `kill`: Kill script
165165

166166
### Various
167167

168-
* `scripts` - List all loaded scripts
169-
* `version` - Display V8's version
168+
* `scripts`: List all loaded scripts
169+
* `version`: Display V8's version
170170

171171
## Advanced Usage
172172

doc/api/deprecations.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,17 @@ API usability issues that can lead to accidental security issues.
141141
As an alternative, use one of the following methods of constructing `Buffer`
142142
objects:
143143

144-
* [`Buffer.alloc(size[, fill[, encoding]])`][alloc] - Create a `Buffer` with
144+
* [`Buffer.alloc(size[, fill[, encoding]])`][alloc]: Create a `Buffer` with
145145
*initialized* memory.
146-
* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size] - Create a `Buffer` with
146+
* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size]: Create a `Buffer` with
147147
*uninitialized* memory.
148-
* [`Buffer.allocUnsafeSlow(size)`][] - Create a `Buffer` with *uninitialized*
148+
* [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with *uninitialized*
149149
memory.
150-
* [`Buffer.from(array)`][] - Create a `Buffer` with a copy of `array`
150+
* [`Buffer.from(array)`][]: Create a `Buffer` with a copy of `array`
151151
* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] -
152152
Create a `Buffer` that wraps the given `arrayBuffer`.
153-
* [`Buffer.from(buffer)`][] - Create a `Buffer` that copies `buffer`.
154-
* [`Buffer.from(string[, encoding])`][from_string_encoding] - Create a `Buffer`
153+
* [`Buffer.from(buffer)`][]: Create a `Buffer` that copies `buffer`.
154+
* [`Buffer.from(string[, encoding])`][from_string_encoding]: Create a `Buffer`
155155
that copies `string`.
156156

157157
Without `--pending-deprecation`, runtime warnings occur only for code not in

doc/api/dgram.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,8 @@ changes:
706706
* `ipv6Only` {boolean} Setting `ipv6Only` to `true` will
707707
disable dual-stack support, i.e., binding to address `::` won't make
708708
`0.0.0.0` be bound. **Default:** `false`.
709-
* `recvBufferSize` {number} - Sets the `SO_RCVBUF` socket value.
710-
* `sendBufferSize` {number} - Sets the `SO_SNDBUF` socket value.
709+
* `recvBufferSize` {number} Sets the `SO_RCVBUF` socket value.
710+
* `sendBufferSize` {number} Sets the `SO_SNDBUF` socket value.
711711
* `lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][].
712712
* `callback` {Function} Attached as a listener for `'message'` events. Optional.
713713
* Returns: {dgram.Socket}
@@ -725,8 +725,8 @@ and port can be retrieved using [`socket.address().address`][] and
725725
added: v0.1.99
726726
-->
727727

728-
* `type` {string} - Either `'udp4'` or `'udp6'`.
729-
* `callback` {Function} - Attached as a listener to `'message'` events.
728+
* `type` {string} Either `'udp4'` or `'udp6'`.
729+
* `callback` {Function} Attached as a listener to `'message'` events.
730730
* Returns: {dgram.Socket}
731731

732732
Creates a `dgram.Socket` object of the specified `type`.

doc/api/esm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ throw when an attempt is made to import them:
286286

287287
```js
288288
import submodule from 'es-module-package/private-module.js';
289-
// Throws - Module not found
289+
// Throws ERR_MODULE_NOT_FOUND
290290
```
291291

292292
> Note: this is not a strong encapsulation as any private modules can still be

0 commit comments

Comments
 (0)