Skip to content

Commit c9b0b48

Browse files
committed
doc: use **Default:** more consistently
It seems that **Default:** was unofficially decided on as the way to specify default values. This commit updates the API documentation to use this format more consistently.
1 parent 9803729 commit c9b0b48

11 files changed

+49
-49
lines changed

doc/api/assert.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ added:
207207
- v12.19.0
208208
-->
209209

210-
* `fn` {Function} **Default** A no-op function.
211-
* `exact` {number} **Default** `1`.
210+
* `fn` {Function} **Default:** A no-op function.
211+
* `exact` {number} **Default:** `1`.
212212
* Returns: {Function} that wraps `fn`.
213213

214214
The wrapper function is expected to be called exactly `exact` times. If the

doc/api/buffer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ added: v15.7.0
307307
any mix of such objects, that will be stored within the `Blob`.
308308
* `options` {Object}
309309
* `encoding` {string} The character encoding to use for string sources.
310-
**Default**: `'utf8'`.
310+
**Default:** `'utf8'`.
311311
* `type` {string} The Blob content-type. The intent is for `type` to convey
312312
the MIME media type of the data, however no validation of the type format
313313
is performed.

doc/api/cluster.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ added: v0.9.12
423423
-->
424424

425425
* `signal` {string} Name of the kill signal to send to the worker
426-
process. **Default**: `'SIGTERM'`
426+
process. **Default:** `'SIGTERM'`
427427

428428
This function will kill the worker. In the primary, it does this
429429
by disconnecting the `worker.process`, and once disconnected, killing

doc/api/crypto.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -1741,11 +1741,11 @@ added: v15.6.0
17411741

17421742
* `email` {string}
17431743
* `options` {Object}
1744-
* `subject` {string} `'always'` or `'never'`. **Defaults**: `'always'`.
1745-
* `wildcards` {boolean} **Defaults**: `true`.
1746-
* `partialWildcards` {boolean} **Defaults**: `true`.
1747-
* `multiLabelWildcards` {boolean} **Defaults**: `false`.
1748-
* `singleLabelSubdomains` {boolean} **Defaults**: `false`.
1744+
* `subject` {string} `'always'` or `'never'`. **Default:** `'always'`.
1745+
* `wildcards` {boolean} **Default:** `true`.
1746+
* `partialWildcards` {boolean} **Default:** `true`.
1747+
* `multiLabelWildcards` {boolean} **Default:** `false`.
1748+
* `singleLabelSubdomains` {boolean} **Default:** `false`.
17491749
* Returns: {string|undefined} Returns `email` if the certificate matches,
17501750
`undefined` if it does not.
17511751

@@ -1758,11 +1758,11 @@ added: v15.6.0
17581758

17591759
* `name` {string}
17601760
* `options` {Object}
1761-
* `subject` {string} `'always'` or `'never'`. **Defaults**: `'always'`.
1762-
* `wildcards` {boolean} **Defaults**: `true`.
1763-
* `partialWildcards` {boolean} **Defaults**: `true`.
1764-
* `multiLabelWildcards` {boolean} **Defaults**: `false`.
1765-
* `singleLabelSubdomains` {boolean} **Defaults**: `false`.
1761+
* `subject` {string} `'always'` or `'never'`. **Default:** `'always'`.
1762+
* `wildcards` {boolean} **Default:** `true`.
1763+
* `partialWildcards` {boolean} **Default:** `true`.
1764+
* `multiLabelWildcards` {boolean} **Default:** `false`.
1765+
* `singleLabelSubdomains` {boolean} **Default:** `false`.
17661766
* Returns: {string|undefined} Returns `name` if the certificate matches,
17671767
`undefined` if it does not.
17681768

@@ -1775,11 +1775,11 @@ added: v15.6.0
17751775

17761776
* `ip` {string}
17771777
* `options` {Object}
1778-
* `subject` {string} `'always'` or `'never'`. **Defaults**: `'always'`.
1779-
* `wildcards` {boolean} **Defaults**: `true`.
1780-
* `partialWildcards` {boolean} **Defaults**: `true`.
1781-
* `multiLabelWildcards` {boolean} **Defaults**: `false`.
1782-
* `singleLabelSubdomains` {boolean} **Defaults**: `false`.
1778+
* `subject` {string} `'always'` or `'never'`. **Default:** `'always'`.
1779+
* `wildcards` {boolean} **Default:** `true`.
1780+
* `partialWildcards` {boolean} **Default:** `true`.
1781+
* `multiLabelWildcards` {boolean} **Default:** `false`.
1782+
* `singleLabelSubdomains` {boolean} **Default:** `false`.
17831783
* Returns: {string|undefined} Returns `ip` if the certificate matches,
17841784
`undefined` if it does not.
17851785

@@ -2023,7 +2023,7 @@ added: v15.8.0
20232023
is used that yields a false positive rate of at most 2<sup>-64</sup> for
20242024
random input. Care must be used when selecting a number of checks. Refer
20252025
to the OpenSSL documentation for the [`BN_is_prime_ex`][] function `nchecks`
2026-
options for more details. **Defaults**: `0`
2026+
options for more details. **Default:** `0`
20272027
* `callback` {Function}
20282028
* `err` {Error} Set to an {Error} object if an error occurred during check.
20292029
* `result` {boolean} `true` if the candidate is a prime with an error
@@ -2045,7 +2045,7 @@ added: v15.8.0
20452045
is used that yields a false positive rate of at most 2<sup>-64</sup> for
20462046
random input. Care must be used when selecting a number of checks. Refer
20472047
to the OpenSSL documentation for the [`BN_is_prime_ex`][] function `nchecks`
2048-
options for more details. **Defaults**: `0`
2048+
options for more details. **Default:** `0`
20492049
* Returns: {boolean} `true` if the candidate is a prime with an error
20502050
probability less than `0.25 ** options.checks`.
20512051

@@ -2799,7 +2799,7 @@ added: v15.8.0
27992799
* `options` {Object}
28002800
* `add` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}
28012801
* `rem` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}
2802-
* `safe` {boolean} **Defaults**: `false`.
2802+
* `safe` {boolean} **Default:** `false`.
28032803
* `bigint` {boolean} When `true`, the generated prime is returned
28042804
as a `bigint`.
28052805
* `callback` {Function}
@@ -2841,7 +2841,7 @@ added: v15.8.0
28412841
* `options` {Object}
28422842
* `add` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}
28432843
* `rem` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}
2844-
* `safe` {boolean} **Defaults**: `false`.
2844+
* `safe` {boolean} **Default:** `false`.
28452845
* `bigint` {boolean} When `true`, the generated prime is returned
28462846
as a `bigint`.
28472847
* Returns: {ArrayBuffer|bigint}
@@ -3583,7 +3583,7 @@ added:
35833583
- v12.19.0
35843584
-->
35853585

3586-
* `min` {integer} Start of random range (inclusive). **Default**: `0`.
3586+
* `min` {integer} Start of random range (inclusive). **Default:** `0`.
35873587
* `max` {integer} End of random range (exclusive).
35883588
* `callback` {Function} `function(err, n) {}`.
35893589

@@ -3626,7 +3626,7 @@ added: v15.6.0
36263626
Node.js generates and caches enough
36273627
random data to generate up to 128 random UUIDs. To generate a UUID
36283628
without using the cache, set `disableEntropyCache` to `true`.
3629-
**Defaults**: `false`.
3629+
**Default:** `false`.
36303630
* Returns: {string}
36313631

36323632
Generates a random [RFC 4122][] Version 4 UUID.

doc/api/net.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ added: v15.0.0
7070
-->
7171

7272
* `address` {string} An IPv4 or IPv6 address.
73-
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`.
73+
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.
7474

7575
Adds a rule to block the given IP address.
7676

@@ -81,7 +81,7 @@ added: v15.0.0
8181

8282
* `start` {string} The starting IPv4 or IPv6 address in the range.
8383
* `end` {string} The ending IPv4 or IPv6 address in the range.
84-
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`.
84+
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.
8585

8686
Adds a rule to block a range of IP addresses from `start` (inclusive) to
8787
`end` (inclusive).
@@ -95,7 +95,7 @@ added: v15.0.0
9595
* `prefix` {number} The number of CIDR prefix bits. For IPv4, this
9696
must be a value between `0` and `32`. For IPv6, this must be between
9797
`0` and `128`.
98-
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`.
98+
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.
9999

100100
Adds a rule to block a range of IP addresses specified as a subnet mask.
101101

@@ -105,7 +105,7 @@ added: v15.0.0
105105
-->
106106

107107
* `address` {string} The IP address to check
108-
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`.
108+
* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.
109109
* Returns: {boolean}
110110

111111
Returns `true` if the given IP address matches any of the rules added to the

doc/api/os.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ added: v10.10.0
149149
-->
150150

151151
* `pid` {integer} The process ID to retrieve scheduling priority for.
152-
**Default** `0`.
152+
**Default:** `0`.
153153
* Returns: {integer}
154154

155155
Returns the scheduling priority for the process specified by `pid`. If `pid` is
@@ -300,7 +300,7 @@ added: v10.10.0
300300
-->
301301

302302
* `pid` {integer} The process ID to set scheduling priority for.
303-
**Default** `0`.
303+
**Default:** `0`.
304304
* `priority` {integer} The scheduling priority to assign to the process.
305305

306306
Attempts to set the scheduling priority for the process specified by `pid`. If

doc/api/perf_hooks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -660,11 +660,11 @@ added: REPLACEME
660660

661661
* `options` {Object}
662662
* `min` {number|bigint} The minimum recordable value. Must be an integer
663-
value greater than 0. **Defaults**: `1`.
663+
value greater than 0. **Default:** `1`.
664664
* `max` {number|bigint} The maximum recordable value. Must be an integer
665-
value greater than `min`. **Defaults**: `Number.MAX_SAFE_INTEGER`.
665+
value greater than `min`. **Default:** `Number.MAX_SAFE_INTEGER`.
666666
* `figures` {number} The number of accuracy digits. Must be a number between
667-
`1` and `5`. **Defaults**: `3`.
667+
`1` and `5`. **Default:** `3`.
668668
* Returns {RecordableHistogram}
669669

670670
Returns a {RecordableHistogram}.

doc/api/stream.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1597,13 +1597,13 @@ changes:
15971597
* `stream` {Stream} A readable and/or writable stream.
15981598
* `options` {Object}
15991599
* `error` {boolean} If set to `false`, then a call to `emit('error', err)` is
1600-
not treated as finished. **Default**: `true`.
1600+
not treated as finished. **Default:** `true`.
16011601
* `readable` {boolean} When set to `false`, the callback will be called when
16021602
the stream ends even though the stream might still be readable.
1603-
**Default**: `true`.
1603+
**Default:** `true`.
16041604
* `writable` {boolean} When set to `false`, the callback will be called when
16051605
the stream ends even though the stream might still be writable.
1606-
**Default**: `true`.
1606+
**Default:** `true`.
16071607
* `callback` {Function} A callback function that takes an optional error
16081608
argument.
16091609
* Returns: {Function} A cleanup function which removes all registered

doc/api/timers.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ added: v0.0.1
197197

198198
* `callback` {Function} The function to call when the timer elapses.
199199
* `delay` {number} The number of milliseconds to wait before calling the
200-
`callback`. **Default**: `1`.
200+
`callback`. **Default:** `1`.
201201
* `...args` {any} Optional arguments to pass when the `callback` is called.
202202
* Returns: {Timeout} for use with [`clearInterval()`][]
203203

@@ -215,7 +215,7 @@ added: v0.0.1
215215

216216
* `callback` {Function} The function to call when the timer elapses.
217217
* `delay` {number} The number of milliseconds to wait before calling the
218-
`callback`. **Default**: `1`.
218+
`callback`. **Default:** `1`.
219219
* `...args` {any} Optional arguments to pass when the `callback` is called.
220220
* Returns: {Timeout} for use with [`clearTimeout()`][]
221221

@@ -341,12 +341,12 @@ added: v15.0.0
341341
-->
342342

343343
* `delay` {number} The number of milliseconds to wait before resolving the
344-
`Promise`. **Default**: `1`.
344+
`Promise`. **Default:** `1`.
345345
* `value` {any} A value with which the `Promise` is resolved.
346346
* `options` {Object}
347347
* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout`
348348
should not require the Node.js event loop to remain active.
349-
**Default**: `true`.
349+
**Default:** `true`.
350350
* `signal` {AbortSignal} An optional `AbortSignal` that can be used to
351351
cancel the scheduled `Timeout`.
352352

@@ -359,7 +359,7 @@ added: v15.0.0
359359
* `options` {Object}
360360
* `ref` {boolean} Set to `false` to indicate that the scheduled `Immediate`
361361
should not require the Node.js event loop to remain active.
362-
**Default**: `true`.
362+
**Default:** `true`.
363363
* `signal` {AbortSignal} An optional `AbortSignal` that can be used to
364364
cancel the scheduled `Immediate`.
365365

@@ -371,13 +371,13 @@ added: REPLACEME
371371
Returns an async iterator that generates values in an interval of `delay` ms.
372372

373373
* `delay` {number} The number of milliseconds to wait between iterations.
374-
**Default**: `1`.
374+
**Default:** `1`.
375375
* `value` {any} A value with which the iterator returns.
376376
* `options` {Object}
377377
* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout`
378378
between iterations should not require the Node.js event loop to
379379
remain active.
380-
**Default**: `true`.
380+
**Default:** `true`.
381381
* `signal` {AbortSignal} An optional `AbortSignal` that can be used to
382382
cancel the scheduled `Timeout` between operations.
383383

doc/api/webcrypto.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ added: v15.0.0
985985

986986
* Type: {number} The size in bits of the generated authentication tag.
987987
This values must be one of `32`, `64`, `96`, `104`, `112`, `120`, or
988-
`128`. **Default**: `128`.
988+
`128`. **Default:** `128`.
989989

990990
### Class: `AesImportParams`
991991
<!-- YAML
@@ -1746,21 +1746,21 @@ added: v15.0.0
17461746
-->
17471747

17481748
* Type: {number} The CPU/memory cost parameter. Must e a power of two
1749-
greater than 1. **Default** `16384`.
1749+
greater than 1. **Default:** `16384`.
17501750

17511751
##### `nodeScryptParams.p`
17521752
<!-- YAML
17531753
added: v15.0.0
17541754
-->
17551755

1756-
* Type: {number} Parallelization parameter. **Default** `1`.
1756+
* Type: {number} Parallelization parameter. **Default:** `1`.
17571757

17581758
##### `nodeScryptParams.r`
17591759
<!-- YAML
17601760
added: v15.0.0
17611761
-->
17621762

1763-
* Type: {number} Block size parameter. **Default**: `8`.
1763+
* Type: {number} Block size parameter. **Default:** `8`.
17641764

17651765
##### `nodeScryptParams.salt`
17661766
<!-- YAML

doc/api/worker_threads.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ changes:
862862
[`fs.close()`][], and closes them when the Worker exits, similar to other
863863
resources like network sockets or file descriptors managed through
864864
the [`FileHandle`][] API. This option is automatically inherited by all
865-
nested `Worker`s. **Default**: `true`.
865+
nested `Worker`s. **Default:** `true`.
866866
* `transferList` {Object[]} If one or more `MessagePort`-like objects
867867
are passed in `workerData`, a `transferList` is required for those
868868
items or [`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`][] is thrown.

0 commit comments

Comments
 (0)