-
-
Save Trott/0b5070042d8b2198e4f0d036fbfa606b to your computer and use it in GitHub Desktop.
diff for PR 40403
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md | |
index 132f2a6bb2..c3170f8162 100644 | |
--- a/doc/api/async_hooks.md | |
+++ b/doc/api/async_hooks.md | |
@@ -190,7 +190,7 @@ const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); | |
Because promises are asynchronous resources whose lifecycle is tracked | |
via the async hooks mechanism, the `init()`, `before()`, `after()`, and | |
-`destroy()` callbacks *must not* be async functions that return promises. | |
+`destroy()` callbacks _must not_ be async functions that return promises. | |
### Error handling | |
@@ -350,8 +350,8 @@ listening to the hooks. | |
`triggerAsyncId` is the `asyncId` of the resource that caused (or "triggered") | |
the new resource to initialize and that caused `init` to call. This is different | |
-from `async_hooks.executionAsyncId()` that only shows *when* a resource was | |
-created, while `triggerAsyncId` shows *why* a resource was created. | |
+from `async_hooks.executionAsyncId()` that only shows _when_ a resource was | |
+created, while `triggerAsyncId` shows _why_ a resource was created. | |
The following is a simple demonstration of `triggerAsyncId`: | |
@@ -499,13 +499,13 @@ TickObject(6) | |
The `TCPSERVERWRAP` is not part of this graph, even though it was the reason for | |
`console.log()` being called. This is because binding to a port without a host | |
-name is a *synchronous* operation, but to maintain a completely asynchronous | |
+name is a _synchronous_ operation, but to maintain a completely asynchronous | |
API the user's callback is placed in a `process.nextTick()`. Which is why | |
`TickObject` is present in the output and is a 'parent' for `.listen()` | |
callback. | |
-The graph only shows *when* a resource was created, not *why*, so to track | |
-the *why* use `triggerAsyncId`. Which can be represented with the following | |
+The graph only shows _when_ a resource was created, not _why_, so to track | |
+the _why_ use `triggerAsyncId`. Which can be represented with the following | |
graph: | |
```console | |
@@ -545,7 +545,7 @@ it only once. | |
Called immediately after the callback specified in `before` is completed. | |
If an uncaught exception occurs during execution of the callback, then `after` | |
-will run *after* the `'uncaughtException'` event is emitted or a `domain`'s | |
+will run _after_ the `'uncaughtException'` event is emitted or a `domain`'s | |
handler runs. | |
#### `destroy(asyncId)` | |
diff --git a/doc/api/buffer.md b/doc/api/buffer.md | |
index 5c56572457..abe5c88bd8 100644 | |
--- a/doc/api/buffer.md | |
+++ b/doc/api/buffer.md | |
@@ -472,9 +476,9 @@ changes: | |
and removed the non-standard `encoding` option. | |
--> | |
-* `sources` {string[]|ArrayBuffer[]|TypedArray[]|DataView[]|Blob[]} An array | |
- of string, {ArrayBuffer}, {TypedArray}, {DataView}, or {Blob} objects, or | |
- any mix of such objects, that will be stored within the `Blob`. | |
+* `sources` {string\[]|ArrayBuffer\[]|TypedArray\[]|DataView\[]|Blob\[]} An | |
+ array of string, {ArrayBuffer}, {TypedArray}, {DataView}, or {Blob} objects, | |
+ or any mix of such objects, that will be stored within the `Blob`. | |
* `options` {Object} | |
* `endings` {string} One of either `'transparent'` or `'native'`. When set | |
to `'native'`, line endings in string source parts will be converted to | |
@@ -746,9 +758,9 @@ Allocates a new `Buffer` of `size` bytes. If `size` is larger than | |
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_ARG_VALUE`][] | |
is thrown. | |
-The underlying memory for `Buffer` instances created in this way is *not | |
-initialized*. The contents of the newly created `Buffer` are unknown and | |
-*may contain sensitive data*. Use [`Buffer.alloc()`][] instead to initialize | |
+The underlying memory for `Buffer` instances created in this way is _not | |
+initialized_. The contents of the newly created `Buffer` are unknown and | |
+_may contain sensitive data_. Use [`Buffer.alloc()`][] instead to initialize | |
`Buffer` instances with zeroes. | |
```mjs | |
@@ -790,8 +802,8 @@ to `Buffer.poolSize >> 1` (floor of [`Buffer.poolSize`][] divided by two). | |
Use of this pre-allocated internal memory pool is a key difference between | |
calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. | |
-Specifically, `Buffer.alloc(size, fill)` will *never* use the internal `Buffer` | |
-pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal | |
+Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer` | |
+pool, while `Buffer.allocUnsafe(size).fill(fill)` _will_ use the internal | |
`Buffer` pool if `size` is less than or equal to half [`Buffer.poolSize`][]. The | |
difference is subtle but can be important when an application requires the | |
additional performance that [`Buffer.allocUnsafe()`][] provides. | |
@@ -812,9 +825,9 @@ Allocates a new `Buffer` of `size` bytes. If `size` is larger than | |
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_ARG_VALUE`][] | |
is thrown. A zero-length `Buffer` is created if `size` is 0. | |
-The underlying memory for `Buffer` instances created in this way is *not | |
-initialized*. The contents of the newly created `Buffer` are unknown and | |
-*may contain sensitive data*. Use [`buf.fill(0)`][`buf.fill()`] to initialize | |
+The underlying memory for `Buffer` instances created in this way is _not | |
+initialized_. The contents of the newly created `Buffer` are unknown and | |
+_may contain sensitive data_. Use [`buf.fill(0)`][`buf.fill()`] to initialize | |
such `Buffer` instances with zeroes. | |
When using [`Buffer.allocUnsafe()`][] to allocate new `Buffer` instances, | |
@@ -974,7 +990,7 @@ changes: | |
description: The elements of `list` can now be `Uint8Array`s. | |
--> | |
-* `list` {Buffer[] | Uint8Array[]} List of `Buffer` or [`Uint8Array`][] | |
+* `list` {Buffer\[] | Uint8Array\[]} List of `Buffer` or [`Uint8Array`][] | |
instances to concatenate. | |
* `totalLength` {integer} Total length of the `Buffer` instances in `list` | |
when concatenated. | |
@@ -1043,7 +1060,7 @@ console.log(bufA.length); | |
added: v5.10.0 | |
--> | |
-* `array` {integer[]} | |
+* `array` {integer\[]} | |
Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. | |
Array entries outside that range will be truncated to fit into it. | |
@@ -1553,8 +1578,8 @@ comes before, after, or is the same as `target` in sort order. | |
Comparison is based on the actual sequence of bytes in each `Buffer`. | |
* `0` is returned if `target` is the same as `buf` | |
-* `1` is returned if `target` should come *before* `buf` when sorted. | |
-* `-1` is returned if `target` should come *after* `buf` when sorted. | |
+* `1` is returned if `target` should come _before_ `buf` when sorted. | |
+* `-1` is returned if `target` should come _after_ `buf` when sorted. | |
```mjs | |
import { Buffer } from 'buffer'; | |
@@ -3390,7 +3450,7 @@ added: v5.10.0 | |
* Returns: {Buffer} A reference to `buf`. | |
Interprets `buf` as an array of unsigned 16-bit integers and swaps the | |
-byte order *in-place*. Throws [`ERR_INVALID_BUFFER_SIZE`][] if [`buf.length`][] | |
+byte order _in-place_. Throws [`ERR_INVALID_BUFFER_SIZE`][] if [`buf.length`][] | |
is not a multiple of 2. | |
```mjs | |
@@ -3456,7 +3517,7 @@ added: v5.10.0 | |
* Returns: {Buffer} A reference to `buf`. | |
Interprets `buf` as an array of unsigned 32-bit integers and swaps the | |
-byte order *in-place*. Throws [`ERR_INVALID_BUFFER_SIZE`][] if [`buf.length`][] | |
+byte order _in-place_. Throws [`ERR_INVALID_BUFFER_SIZE`][] if [`buf.length`][] | |
is not a multiple of 4. | |
```mjs | |
@@ -3504,7 +3566,7 @@ added: v6.3.0 | |
* Returns: {Buffer} A reference to `buf`. | |
-Interprets `buf` as an array of 64-bit numbers and swaps byte order *in-place*. | |
+Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. | |
Throws [`ERR_INVALID_BUFFER_SIZE`][] if [`buf.length`][] is not a multiple of 8. | |
```mjs | |
@@ -4783,7 +4872,7 @@ changes: | |
> Stability: 0 - Deprecated: Use [`Buffer.from(array)`][] instead. | |
-* `array` {integer[]} An array of bytes to copy from. | |
+* `array` {integer\[]} An array of bytes to copy from. | |
See [`Buffer.from(array)`][]. | |
@@ -5107,11 +5212,11 @@ differently based on what arguments are provided: | |
* Passing a number as the first argument to `Buffer()` (e.g. `new Buffer(10)`) | |
allocates a new `Buffer` object of the specified size. Prior to Node.js 8.0.0, | |
- the memory allocated for such `Buffer` instances is *not* initialized and | |
- *can contain sensitive data*. Such `Buffer` instances *must* be subsequently | |
+ the memory allocated for such `Buffer` instances is _not_ initialized and | |
+ _can contain sensitive data_. Such `Buffer` instances _must_ be subsequently | |
initialized by using either [`buf.fill(0)`][`buf.fill()`] or by writing to the | |
entire `Buffer` before reading data from the `Buffer`. | |
- While this behavior is *intentional* to improve performance, | |
+ While this behavior is _intentional_ to improve performance, | |
development experience has demonstrated that a more explicit distinction is | |
required between creating a fast-but-uninitialized `Buffer` versus creating a | |
slower-but-safer `Buffer`. Since Node.js 8.0.0, `Buffer(num)` and `new | |
@@ -5145,18 +5250,18 @@ the various forms of the `new Buffer()` constructor have been **deprecated** | |
and replaced by separate `Buffer.from()`, [`Buffer.alloc()`][], and | |
[`Buffer.allocUnsafe()`][] methods. | |
-*Developers should migrate all existing uses of the `new Buffer()` constructors | |
-to one of these new APIs.* | |
+_Developers should migrate all existing uses of the `new Buffer()` constructors | |
+to one of these new APIs._ | |
-* [`Buffer.from(array)`][] returns a new `Buffer` that *contains a copy* of the | |
+* [`Buffer.from(array)`][] returns a new `Buffer` that _contains a copy_ of the | |
provided octets. | |
* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][`Buffer.from(arrayBuf)`] | |
- returns a new `Buffer` that *shares the same allocated memory* as the given | |
+ returns a new `Buffer` that _shares the same allocated memory_ as the given | |
[`ArrayBuffer`][]. | |
-* [`Buffer.from(buffer)`][] returns a new `Buffer` that *contains a copy* of the | |
+* [`Buffer.from(buffer)`][] returns a new `Buffer` that _contains a copy_ of the | |
contents of the given `Buffer`. | |
* [`Buffer.from(string[, encoding])`][`Buffer.from(string)`] returns a new | |
- `Buffer` that *contains a copy* of the provided string. | |
+ `Buffer` that _contains a copy_ of the provided string. | |
* [`Buffer.alloc(size[, fill[, encoding]])`][`Buffer.alloc()`] returns a new | |
initialized `Buffer` of the specified size. This method is slower than | |
[`Buffer.allocUnsafe(size)`][`Buffer.allocUnsafe()`] but guarantees that newly | |
@@ -5169,9 +5274,9 @@ to one of these new APIs.* | |
potentially sensitive. | |
`Buffer` instances returned by [`Buffer.allocUnsafe()`][] and | |
-[`Buffer.from(array)`][] *may* be allocated off a shared internal memory pool | |
+[`Buffer.from(array)`][] _may_ be allocated off a shared internal memory pool | |
if `size` is less than or equal to half [`Buffer.poolSize`][]. Instances | |
-returned by [`Buffer.allocUnsafeSlow()`][] *never* use the shared internal | |
+returned by [`Buffer.allocUnsafeSlow()`][] _never_ use the shared internal | |
memory pool. | |
### The `--zero-fill-buffers` command-line option | |
@@ -5196,14 +5302,14 @@ $ node --zero-fill-buffers | |
### What makes `Buffer.allocUnsafe()` and `Buffer.allocUnsafeSlow()` "unsafe"? | |
When calling [`Buffer.allocUnsafe()`][] and [`Buffer.allocUnsafeSlow()`][], the | |
-segment of allocated memory is *uninitialized* (it is not zeroed-out). While | |
+segment of allocated memory is _uninitialized_ (it is not zeroed-out). While | |
this design makes the allocation of memory quite fast, the allocated segment of | |
memory might contain old data that is potentially sensitive. Using a `Buffer` | |
-created by [`Buffer.allocUnsafe()`][] without *completely* overwriting the | |
+created by [`Buffer.allocUnsafe()`][] without _completely_ overwriting the | |
memory can allow this old data to be leaked when the `Buffer` memory is read. | |
While there are clear performance advantages to using | |
-[`Buffer.allocUnsafe()`][], extra care *must* be taken in order to avoid | |
+[`Buffer.allocUnsafe()`][], extra care _must_ be taken in order to avoid | |
introducing security vulnerabilities into an application. | |
[ASCII]: https://en.wikipedia.org/wiki/ASCII | |
diff --git a/doc/api/child_process.md b/doc/api/child_process.md | |
index 340a0f0577..c0f980a3bb 100644 | |
--- a/doc/api/child_process.md | |
+++ b/doc/api/child_process.md | |
@@ -190,7 +191,7 @@ changes: | |
Spawns a shell then executes the `command` within that shell, buffering any | |
generated output. The `command` string passed to the exec function is processed | |
directly by the shell and special characters (vary based on | |
-[shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) | |
+[shell](https://en.wikipedia.org/wiki/List\_of\_command-line\_interpreters)) | |
need to be dealt with accordingly: | |
```js | |
@@ -294,7 +296,7 @@ changes: | |
--> | |
* `file` {string} The name or path of the executable file to run. | |
-* `args` {string[]} List of string arguments. | |
+* `args` {string\[]} List of string arguments. | |
* `options` {Object} | |
* `cwd` {string|URL} Current working directory of the child process. | |
* `env` {Object} Environment key-value pairs. **Default:** `process.env`. | |
@@ -423,7 +426,7 @@ changes: | |
--> | |
* `modulePath` {string} The module to run in the child. | |
-* `args` {string[]} List of string arguments. | |
+* `args` {string\[]} List of string arguments. | |
* `options` {Object} | |
* `cwd` {string|URL} Current working directory of the child process. | |
* `detached` {boolean} Prepare child to run independently of its parent | |
@@ -431,7 +434,7 @@ changes: | |
[`options.detached`][]). | |
* `env` {Object} Environment key-value pairs. **Default:** `process.env`. | |
* `execPath` {string} Executable used to create the child process. | |
- * `execArgv` {string[]} List of string arguments passed to the executable. | |
+ * `execArgv` {string\[]} List of string arguments passed to the executable. | |
**Default:** `process.execArgv`. | |
* `gid` {number} Sets the group identity of the process (see setgid(2)). | |
* `serialization` {string} Specify the kind of serialization used for sending | |
@@ -547,7 +551,7 @@ changes: | |
--> | |
* `command` {string} The command to run. | |
-* `args` {string[]} List of string arguments. | |
+* `args` {string\[]} List of string arguments. | |
* `options` {Object} | |
* `cwd` {string|URL} Current working directory of the child process. | |
* `env` {Object} Environment key-value pairs. **Default:** `process.env`. | |
@@ -796,13 +801,13 @@ pipes between the parent and child. The value is one of the following: | |
`child_process` object as [`subprocess.stdio[fd]`][`subprocess.stdio`]. Pipes | |
created for fds 0, 1, and 2 are also available as [`subprocess.stdin`][], | |
[`subprocess.stdout`][] and [`subprocess.stderr`][], respectively. | |
-1. `'overlapped'`: Same as `'pipe'` except that the `FILE_FLAG_OVERLAPPED` flag | |
+2. `'overlapped'`: Same as `'pipe'` except that the `FILE_FLAG_OVERLAPPED` flag | |
is set on the handle. This is necessary for overlapped I/O on the child | |
process's stdio handles. See the | |
[docs](https://docs.microsoft.com/en-us/windows/win32/fileio/synchronous-and-asynchronous-i-o) | |
for more details. This is exactly the same as `'pipe'` on non-Windows | |
systems. | |
-1. `'ipc'`: Create an IPC channel for passing messages/file descriptors | |
+3. `'ipc'`: Create an IPC channel for passing messages/file descriptors | |
between parent and child. A [`ChildProcess`][] may have at most one IPC | |
stdio file descriptor. Setting this option enables the | |
[`subprocess.send()`][] method. If the child is a Node.js process, the | |
@@ -813,25 +818,25 @@ pipes between the parent and child. The value is one of the following: | |
Accessing the IPC channel fd in any way other than [`process.send()`][] | |
or using the IPC channel with a child process that is not a Node.js instance | |
is not supported. | |
-1. `'ignore'`: Instructs Node.js to ignore the fd in the child. While Node.js | |
+4. `'ignore'`: Instructs Node.js to ignore the fd in the child. While Node.js | |
will always open fds 0, 1, and 2 for the processes it spawns, setting the fd | |
to `'ignore'` will cause Node.js to open `/dev/null` and attach it to the | |
child's fd. | |
-1. `'inherit'`: Pass through the corresponding stdio stream to/from the | |
+5. `'inherit'`: Pass through the corresponding stdio stream to/from the | |
parent process. In the first three positions, this is equivalent to | |
`process.stdin`, `process.stdout`, and `process.stderr`, respectively. In | |
any other position, equivalent to `'ignore'`. | |
-1. {Stream} object: Share a readable or writable stream that refers to a tty, | |
+6. {Stream} object: Share a readable or writable stream that refers to a tty, | |
file, socket, or a pipe with the child process. The stream's underlying | |
file descriptor is duplicated in the child process to the fd that | |
corresponds to the index in the `stdio` array. The stream must have an | |
underlying descriptor (file streams do not until the `'open'` event has | |
occurred). | |
-1. Positive integer: The integer value is interpreted as a file descriptor | |
+7. Positive integer: The integer value is interpreted as a file descriptor | |
that is currently open in the parent process. It is shared with the child | |
process, similar to how {Stream} objects can be shared. Passing sockets | |
is not supported on Windows. | |
-1. `null`, `undefined`: Use default value. For stdio fds 0, 1, and 2 (in other | |
+8. `null`, `undefined`: Use default value. For stdio fds 0, 1, and 2 (in other | |
words, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the | |
default is `'ignore'`. | |
@@ -849,12 +854,12 @@ spawn('prg', [], { stdio: ['pipe', 'pipe', process.stderr] }); | |
spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] }); | |
``` | |
-*It is worth noting that when an IPC channel is established between the | |
+_It is worth noting that when an IPC channel is established between the | |
parent and child processes, and the child is a Node.js process, the child | |
is launched with the IPC channel unreferenced (using `unref()`) until the | |
child registers an event handler for the [`'disconnect'`][] event | |
or the [`'message'`][] event. This allows the child to exit | |
-normally without the process being held open by the open IPC channel.* | |
+normally without the process being held open by the open IPC channel._ | |
On Unix-like operating systems, the [`child_process.spawn()`][] method | |
performs memory operations synchronously before decoupling the event loop | |
@@ -903,7 +909,7 @@ changes: | |
--> | |
* `file` {string} The name or path of the executable file to run. | |
-* `args` {string[]} List of string arguments. | |
+* `args` {string\[]} List of string arguments. | |
* `options` {Object} | |
* `cwd` {string|URL} Current working directory of the child process. | |
* `input` {string|Buffer|TypedArray|DataView} The value which will be passed | |
@@ -1047,7 +1055,7 @@ changes: | |
--> | |
* `command` {string} The command to run. | |
-* `args` {string[]} List of string arguments. | |
+* `args` {string\[]} List of string arguments. | |
* `options` {Object} | |
* `cwd` {string|URL} Current working directory of the child process. | |
* `input` {string|Buffer|TypedArray|DataView} The value which will be passed | |
diff --git a/doc/api/cli.md b/doc/api/cli.md | |
index 74057706bf..49fd8ec840 100644 | |
--- a/doc/api/cli.md | |
+++ b/doc/api/cli.md | |
@@ -288,9 +312,11 @@ Use the specified file as a security policy. | |
<!-- YAML | |
added: v16.6.0 | |
--> | |
- Use this flag to disable top-level await in REPL. | |
+ | |
+Use this flag to disable top-level await in REPL. | |
### `--experimental-specifier-resolution=mode` | |
+ | |
<!-- YAML | |
added: | |
- v13.4.0 | |
@@ -475,9 +512,10 @@ added: v12.4.0 | |
> Stability: 1 - Experimental | |
Specify the average sampling interval in bytes for the heap profiles generated | |
-by `--heap-prof`. The default is 512 * 1024 bytes. | |
+by `--heap-prof`. The default is 512 \* 1024 bytes. | |
### `--heap-prof-name` | |
+ | |
<!-- YAML | |
added: v12.4.0 | |
--> | |
@@ -678,7 +736,7 @@ added: v8.0.0 | |
Emit pending deprecation warnings. | |
Pending deprecations are generally identical to a runtime deprecation with the | |
-notable exception that they are turned *off* by default and will not be emitted | |
+notable exception that they are turned _off_ by default and will not be emitted | |
unless either the `--pending-deprecation` command-line flag, or the | |
`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations | |
are used to provide a kind of selective "early warning" mechanism that | |
@@ -730,7 +790,7 @@ symlink path for modules as opposed to the real path, allowing symbolically | |
linked peer dependencies to be found. | |
Note, however, that using `--preserve-symlinks` can have other side effects. | |
-Specifically, symbolically linked *native* modules can fail to load if those | |
+Specifically, symbolically linked _native_ modules can fail to load if those | |
are linked from more than one location in the dependency tree (Node.js would | |
see those as two separate modules and would attempt to load the module multiple | |
times, causing an exception to be thrown). | |
@@ -1544,7 +1668,7 @@ added: v8.0.0 | |
When set to `1`, emit pending deprecation warnings. | |
Pending deprecations are generally identical to a runtime deprecation with the | |
-notable exception that they are turned *off* by default and will not be emitted | |
+notable exception that they are turned _off_ by default and will not be emitted | |
unless either the `--pending-deprecation` command-line flag, or the | |
`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations | |
are used to provide a kind of selective "early warning" mechanism that | |
@@ -1695,8 +1825,7 @@ added: v6.11.0 | |
--> | |
Load an OpenSSL configuration file on startup. Among other uses, this can be | |
-used to enable FIPS-compliant crypto if Node.js is built with `./configure | |
---openssl-fips`. | |
+used to enable FIPS-compliant crypto if Node.js is built with `./configure --openssl-fips`. | |
If the [`--openssl-config`][] command-line option is used, the environment | |
variable is ignored. | |
diff --git a/doc/api/cluster.md b/doc/api/cluster.md | |
index f3e7b9d535..609a334d97 100644 | |
--- a/doc/api/cluster.md | |
+++ b/doc/api/cluster.md | |
@@ -390,7 +398,7 @@ connections will be allowed to close as usual. When no more connections exist, | |
see [`server.close()`][], the IPC channel to the worker will close allowing it | |
to die gracefully. | |
-The above applies *only* to server connections, client connections are not | |
+The above applies _only_ to server connections, client connections are not | |
automatically closed by workers, and disconnect does not wait for them to close | |
before exiting. | |
@@ -894,10 +923,10 @@ changes: | |
--> | |
* {Object} | |
- * `execArgv` {string[]} List of string arguments passed to the Node.js | |
+ * `execArgv` {string\[]} List of string arguments passed to the Node.js | |
executable. **Default:** `process.execArgv`. | |
* `exec` {string} File path to worker file. **Default:** `process.argv[1]`. | |
- * `args` {string[]} String arguments passed to worker. | |
+ * `args` {string\[]} String arguments passed to worker. | |
**Default:** `process.argv.slice(2)`. | |
* `cwd` {string} Current working directory of the worker process. **Default:** | |
`undefined` (inherits from parent process). | |
diff --git a/doc/api/console.md b/doc/api/console.md | |
index 411366ab2f..5c8b4ecc64 100644 | |
--- a/doc/api/console.md | |
+++ b/doc/api/console.md | |
@@ -17,7 +17,7 @@ The module exports two specific components: | |
[`process.stderr`][]. The global `console` can be used without calling | |
`require('console')`. | |
-***Warning***: The global console object's methods are neither consistently | |
+_**Warning**_: The global console object's methods are neither consistently | |
synchronous like the browser APIs they resemble, nor are they consistently | |
asynchronous like all other Node.js streams. See the [note on process I/O][] for | |
more information. | |
@@ -273,8 +284,8 @@ added: v0.1.101 | |
formatting the object. This is useful for inspecting large complicated | |
objects. To make it recurse indefinitely, pass `null`. **Default:** `2`. | |
* `colors` {boolean} If `true`, then the output will be styled with ANSI color | |
- codes. Colors are customizable; | |
- see [customizing `util.inspect()` colors][]. **Default:** `false`. | |
+ codes. Colors are customizable; | |
+ see [customizing `util.inspect()` colors][]. **Default:** `false`. | |
Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. | |
This function bypasses any custom `inspect()` function defined on `obj`. | |
@@ -385,7 +404,7 @@ added: v10.0.0 | |
--> | |
* `tabularData` {any} | |
-* `properties` {string[]} Alternate properties for constructing the table. | |
+* `properties` {string\[]} Alternate properties for constructing the table. | |
Try to construct a table with the columns of the properties of `tabularData` | |
(or use `properties`) and rows of `tabularData` and log it. Falls back to just | |
diff --git a/doc/api/crypto.md b/doc/api/crypto.md | |
index b01203493b..7a64303fd6 100644 | |
--- a/doc/api/crypto.md | |
+++ b/doc/api/crypto.md | |
@@ -52,7 +52,7 @@ try { | |
When using the lexical ESM `import` keyword, the error can only be | |
caught if a handler for `process.on('uncaughtException')` is registered | |
-*before* any attempt to load the module is made -- using, for instance, | |
+_before_ any attempt to load the module is made -- using, for instance, | |
a preload module. | |
When using ESM, if there is a chance that the code may be run on a build | |
@@ -2005,8 +2055,8 @@ For private keys, the following encoding options can be used: | |
`'sec1'` (EC only). | |
* `format`: {string} Must be `'pem'`, `'der'`, or `'jwk'`. | |
* `cipher`: {string} If specified, the private key will be encrypted with | |
- the given `cipher` and `passphrase` using PKCS#5 v2.0 password based | |
- encryption. | |
+ the given `cipher` and `passphrase` using PKCS#5 v2.0 password based | |
+ encryption. | |
* `passphrase`: {string | Buffer} The passphrase to use for encryption, see | |
`cipher`. | |
@@ -2520,7 +2598,7 @@ available. | |
added: v15.6.0 | |
--> | |
-* Type: {string[]} | |
+* Type: {string\[]} | |
An array detailing the key usages for this certificate. | |
@@ -3195,7 +3301,7 @@ changes: | |
* `format`: {string} Must be `'pem'`, `'der'`, or '`'jwk'`. | |
**Default:** `'pem'`. | |
* `type`: {string} Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is | |
- required only if the `format` is `'der'` and ignored otherwise. | |
+ required only if the `format` is `'der'` and ignored otherwise. | |
* `passphrase`: {string | Buffer} The passphrase to use for decryption. | |
* `encoding`: {string} The string encoding to use when `key` is a string. | |
* Returns: {KeyObject} | |
@@ -3235,9 +3344,10 @@ changes: | |
* `format`: {string} Must be `'pem'`, `'der'`, or `'jwk'`. | |
**Default:** `'pem'`. | |
* `type`: {string} Must be `'pkcs1'` or `'spki'`. This option is | |
- required only if the `format` is `'der'` and ignored otherwise. | |
+ required only if the `format` is `'der'` and ignored otherwise. | |
* `encoding` {string} The string encoding to use when `key` is a string. | |
* Returns: {KeyObject} | |
+ | |
<!--lint enable maximum-line-length remark-lint--> | |
Creates and returns a new key object containing a public key. If `key` is a | |
@@ -3745,7 +3867,7 @@ unacceptable, `undefined` will be returned. | |
added: v0.9.3 | |
--> | |
-* Returns: {string[]} An array with the names of the supported cipher | |
+* Returns: {string\[]} An array with the names of the supported cipher | |
algorithms. | |
```mjs | |
@@ -3769,7 +3892,7 @@ console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] | |
added: v2.3.0 | |
--> | |
-* Returns: {string[]} An array with the names of the supported elliptic curves. | |
+* Returns: {string\[]} An array with the names of the supported elliptic curves. | |
```mjs | |
const { | |
@@ -3857,7 +3983,7 @@ added: v10.0.0 | |
added: v0.9.3 | |
--> | |
-* Returns: {string[]} An array of the names of the supported hash algorithms, | |
+* Returns: {string\[]} An array of the names of the supported hash algorithms, | |
such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. | |
```mjs | |
@@ -4196,7 +4328,7 @@ changes: | |
* `oaepHash` {string} The hash function to use for OAEP padding and MGF1. | |
**Default:** `'sha1'` | |
* `oaepLabel` {string|ArrayBuffer|Buffer|TypedArray|DataView} The label to | |
- use for OAEP padding. If not specified, no label is used. | |
+ use for OAEP padding. If not specified, no label is used. | |
* `padding` {crypto.constants} An optional padding value defined in | |
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, | |
`crypto.constants.RSA_PKCS1_PADDING`, or | |
@@ -5051,7 +5208,7 @@ If at least one of `a` and `b` is a `TypedArray` with more than one byte per | |
entry, such as `Uint16Array`, the result will be computed using the platform | |
byte order. | |
-Use of `crypto.timingSafeEqual` does not guarantee that the *surrounding* code | |
+Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code | |
is timing-safe. Care should be taken to ensure that the surrounding code does | |
not introduce timing vulnerabilities. | |
@@ -5244,7 +5406,7 @@ mode must adhere to certain restrictions when using the cipher API: | |
* As CCM processes the whole message at once, `update()` must be called exactly | |
once. | |
* Even though calling `update()` is sufficient to encrypt/decrypt the message, | |
- applications *must* call `final()` to compute or verify the | |
+ applications _must_ call `final()` to compute or verify the | |
authentication tag. | |
```mjs | |
diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md | |
index ef73392a52..dd4da3973f 100644 | |
--- a/doc/api/deprecations.md | |
+++ b/doc/api/deprecations.md | |
@@ -144,11 +149,11 @@ As an alternative, use one of the following methods of constructing `Buffer` | |
objects: | |
* [`Buffer.alloc(size[, fill[, encoding]])`][alloc]: Create a `Buffer` with | |
- *initialized* memory. | |
+ _initialized_ memory. | |
* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size]: Create a `Buffer` with | |
- *uninitialized* memory. | |
-* [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with *uninitialized* | |
- memory. | |
+ _uninitialized_ memory. | |
+* [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with _uninitialized_ | |
+ memory. | |
* [`Buffer.from(array)`][]: Create a `Buffer` with a copy of `array` | |
* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] - | |
Create a `Buffer` that wraps the given `arrayBuffer`. | |
diff --git a/doc/api/dgram.md b/doc/api/dgram.md | |
index 53df741208..dbdd12afd8 100644 | |
--- a/doc/api/dgram.md | |
+++ b/doc/api/dgram.md | |
@@ -538,7 +560,7 @@ The only way to know for sure that the datagram has been sent is by using a | |
passed as the first argument to the `callback`. If a `callback` is not given, | |
the error is emitted as an `'error'` event on the `socket` object. | |
-Offset and length are optional but both *must* be set if either are used. | |
+Offset and length are optional but both _must_ be set if either are used. | |
They are supported only when the first argument is a `Buffer`, a `TypedArray`, | |
or a `DataView`. | |
@@ -675,10 +699,10 @@ added: v8.6.0 | |
* `multicastInterface` {string} | |
-*All references to scope in this section are referring to | |
+_All references to scope in this section are referring to | |
[IPv6 Zone Indices][], which are defined by [RFC 4007][]. In string form, an IP | |
with a scope index is written as `'IP%scope'` where scope is an interface name | |
-or interface number.* | |
+or interface number._ | |
Sets the default outgoing multicast interface of the socket to a chosen | |
interface or back to system interface selection. The `multicastInterface` must | |
@@ -731,10 +756,10 @@ socket.bind(1234, () => { | |
#### Call results | |
-A call on a socket that is not ready to send or no longer open may throw a *Not | |
-running* [`Error`][]. | |
+A call on a socket that is not ready to send or no longer open may throw a _Not | |
+running_ [`Error`][]. | |
-If `multicastInterface` can not be parsed into an IP then an *EINVAL* | |
+If `multicastInterface` can not be parsed into an IP then an _EINVAL_ | |
[`System Error`][] is thrown. | |
On IPv4, if `multicastInterface` is a valid address but does not match any | |
diff --git a/doc/api/dns.md b/doc/api/dns.md | |
index 1a5ecd80b9..84ecc29b66 100644 | |
--- a/doc/api/dns.md | |
+++ b/doc/api/dns.md | |
@@ -152,7 +157,7 @@ The `rrtype` of resolution requests has no impact on the local address used. | |
added: v0.11.3 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns an array of IP address strings, formatted according to [RFC 5952][], | |
that are currently configured for DNS resolution. A string will include a port | |
@@ -311,15 +321,15 @@ added: v0.1.27 | |
* `rrtype` {string} Resource record type. **Default:** `'A'`. | |
* `callback` {Function} | |
* `err` {Error} | |
- * `records` {string[] | Object[] | Object} | |
+ * `records` {string\[] | Object\[] | Object} | |
Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array | |
of the resource records. The `callback` function has arguments | |
`(err, records)`. When successful, `records` will be an array of resource | |
records. The type and structure of individual results varies based on `rrtype`: | |
-| `rrtype` | `records` contains | Result type | Shorthand method | | |
-|-----------|--------------------------------|-------------|--------------------------| | |
+| `rrtype` | `records` contains | Result type | Shorthand method | | |
+| --------- | ------------------------------ | ----------- | ------------------------ | | |
| `'A'` | IPv4 addresses (default) | {string} | [`dns.resolve4()`][] | | |
| `'AAAA'` | IPv6 addresses | {string} | [`dns.resolve6()`][] | | |
| `'ANY'` | any records | {Object} | [`dns.resolveAny()`][] | | |
@@ -331,7 +341,7 @@ records. The type and structure of individual results varies based on `rrtype`: | |
| `'PTR'` | pointer records | {string} | [`dns.resolvePtr()`][] | | |
| `'SOA'` | start of authority records | {Object} | [`dns.resolveSoa()`][] | | |
| `'SRV'` | service records | {Object} | [`dns.resolveSrv()`][] | | |
-| `'TXT'` | text records | {string[]} | [`dns.resolveTxt()`][] | | |
+| `'TXT'` | text records | {string\[]} | [`dns.resolveTxt()`][] | | |
On error, `err` is an [`Error`][] object, where `err.code` is one of the | |
[DNS error codes](). | |
@@ -354,7 +365,7 @@ changes: | |
with the TTL expressed in seconds. | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {string[] | Object[]} | |
+ * `addresses` {string\[] | Object\[]} | |
Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the | |
`hostname`. The `addresses` argument passed to the `callback` function | |
@@ -379,7 +391,7 @@ changes: | |
strings, with the TTL expressed in seconds. | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {string[] | Object[]} | |
+ * `addresses` {string\[] | Object\[]} | |
Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the | |
`hostname`. The `addresses` argument passed to the `callback` function | |
@@ -390,7 +402,7 @@ will contain an array of IPv6 addresses. | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `ret` {Object[]} | |
+ * `ret` {Object\[]} | |
Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). | |
The `ret` argument passed to the `callback` function will be an array containing | |
@@ -398,18 +410,18 @@ various types of records. Each object has a property `type` that indicates the | |
type of the current record. And depending on the `type`, additional properties | |
will be present on the object: | |
-| Type | Properties | | |
-|------|------------| | |
-| `'A'` | `address`/`ttl` | | |
-| `'AAAA'` | `address`/`ttl` | | |
-| `'CNAME'` | `value` | | |
-| `'MX'` | Refer to [`dns.resolveMx()`][] | | |
-| `'NAPTR'` | Refer to [`dns.resolveNaptr()`][] | | |
-| `'NS'` | `value` | | |
-| `'PTR'` | `value` | | |
-| `'SOA'` | Refer to [`dns.resolveSoa()`][] | | |
-| `'SRV'` | Refer to [`dns.resolveSrv()`][] | | |
-| `'TXT'` | This type of record contains an array property called `entries` which refers to [`dns.resolveTxt()`][], e.g. `{ entries: ['...'], type: 'TXT' }` | | |
+| Type | Properties | | |
+| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | |
+| `'A'` | `address`/`ttl` | | |
+| `'AAAA'` | `address`/`ttl` | | |
+| `'CNAME'` | `value` | | |
+| `'MX'` | Refer to [`dns.resolveMx()`][] | | |
+| `'NAPTR'` | Refer to [`dns.resolveNaptr()`][] | | |
+| `'NS'` | `value` | | |
+| `'PTR'` | `value` | | |
+| `'SOA'` | Refer to [`dns.resolveSoa()`][] | | |
+| `'SRV'` | Refer to [`dns.resolveSrv()`][] | | |
+| `'TXT'` | This type of record contains an array property called `entries` which refers to [`dns.resolveTxt()`][], e.g. `{ entries: ['...'], type: 'TXT' }` | | |
Here is an example of the `ret` object passed to the callback: | |
@@ -442,7 +456,7 @@ added: v0.3.2 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {string[]} | |
+ * `addresses` {string\[]} | |
Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The | |
`addresses` argument passed to the `callback` function | |
@@ -459,7 +474,7 @@ added: | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `records` {Object[]} | |
+ * `records` {Object\[]} | |
Uses the DNS protocol to resolve `CAA` records for the `hostname`. The | |
`addresses` argument passed to the `callback` function | |
@@ -475,7 +491,7 @@ added: v0.1.27 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {Object[]} | |
+ * `addresses` {Object\[]} | |
Uses the DNS protocol to resolve mail exchange records (`MX` records) for the | |
`hostname`. The `addresses` argument passed to the `callback` function will | |
@@ -490,7 +507,7 @@ added: v0.9.12 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {Object[]} | |
+ * `addresses` {Object\[]} | |
Uses the DNS protocol to resolve regular expression based records (`NAPTR` | |
records) for the `hostname`. The `addresses` argument passed to the `callback` | |
@@ -523,7 +542,7 @@ added: v0.1.90 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {string[]} | |
+ * `addresses` {string\[]} | |
Uses the DNS protocol to resolve name server records (`NS` records) for the | |
`hostname`. The `addresses` argument passed to the `callback` function will | |
@@ -538,7 +558,7 @@ added: v6.0.0 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {string[]} | |
+ * `addresses` {string\[]} | |
Uses the DNS protocol to resolve pointer records (`PTR` records) for the | |
`hostname`. The `addresses` argument passed to the `callback` function will | |
@@ -587,7 +610,7 @@ added: v0.1.27 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `addresses` {Object[]} | |
+ * `addresses` {Object\[]} | |
Uses the DNS protocol to resolve service records (`SRV` records) for the | |
`hostname`. The `addresses` argument passed to the `callback` function will | |
@@ -617,7 +643,8 @@ added: v0.1.27 | |
* `hostname` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `records` <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string[][]></a> | |
+ * `records` <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type">\<string\[]\[]></a> | |
+ | |
<!--lint enable no-undefined-references list-item-bullet-indent--> | |
Uses the DNS protocol to resolve text queries (`TXT` records) for the | |
@@ -635,7 +663,7 @@ added: v0.1.16 | |
* `ip` {string} | |
* `callback` {Function} | |
* `err` {Error} | |
- * `hostnames` {string[]} | |
+ * `hostnames` {string\[]} | |
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an | |
array of host names. | |
@@ -667,7 +698,7 @@ dns orders in workers. | |
added: v0.11.3 | |
--> | |
-* `servers` {string[]} array of [RFC 5952][] formatted addresses | |
+* `servers` {string\[]} array of [RFC 5952][] formatted addresses | |
Sets the IP address and port of servers to be used when performing DNS | |
resolution. The `servers` argument is an array of [RFC 5952][] formatted | |
@@ -688,13 +719,13 @@ The `dns.setServers()` method must not be called while a DNS query is in | |
progress. | |
The [`dns.setServers()`][] method affects only [`dns.resolve()`][], | |
-`dns.resolve*()` and [`dns.reverse()`][] (and specifically *not* | |
+`dns.resolve*()` and [`dns.reverse()`][] (and specifically _not_ | |
[`dns.lookup()`][]). | |
This method works much like | |
[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). | |
That is, if attempting to resolve with the first server provided results in a | |
-`NOTFOUND` error, the `resolve()` method will *not* attempt to resolve with | |
+`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with | |
subsequent servers provided. Fallback DNS servers will only be used if the | |
earlier ones time out or result in some other error. | |
@@ -778,7 +813,7 @@ promises will be rejected with an error with code `ECANCELLED`. | |
added: v10.6.0 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns an array of IP address strings, formatted according to [RFC 5952][], | |
that are currently configured for DNS resolution. A string will include a port | |
@@ -899,12 +938,12 @@ of the resource records. When successful, the `Promise` is resolved with an | |
array of resource records. The type and structure of individual results vary | |
based on `rrtype`: | |
-| `rrtype` | `records` contains | Result type | Shorthand method | | |
-|-----------|--------------------------------|-------------|--------------------------| | |
+| `rrtype` | `records` contains | Result type | Shorthand method | | |
+| --------- | ------------------------------ | ----------- | -------------------------------- | | |
| `'A'` | IPv4 addresses (default) | {string} | [`dnsPromises.resolve4()`][] | | |
| `'AAAA'` | IPv6 addresses | {string} | [`dnsPromises.resolve6()`][] | | |
| `'ANY'` | any records | {Object} | [`dnsPromises.resolveAny()`][] | | |
-| `'CAA'` | CA authorization records | {Object} | [`dnsPromises.resolveCaa()`][] | | |
+| `'CAA'` | CA authorization records | {Object} | [`dnsPromises.resolveCaa()`][] | | |
| `'CNAME'` | canonical name records | {string} | [`dnsPromises.resolveCname()`][] | | |
| `'MX'` | mail exchange records | {Object} | [`dnsPromises.resolveMx()`][] | | |
| `'NAPTR'` | name authority pointer records | {Object} | [`dnsPromises.resolveNaptr()`][] | | |
@@ -912,7 +951,7 @@ based on `rrtype`: | |
| `'PTR'` | pointer records | {string} | [`dnsPromises.resolvePtr()`][] | | |
| `'SOA'` | start of authority records | {Object} | [`dnsPromises.resolveSoa()`][] | | |
| `'SRV'` | service records | {Object} | [`dnsPromises.resolveSrv()`][] | | |
-| `'TXT'` | text records | {string[]} | [`dnsPromises.resolveTxt()`][] | | |
+| `'TXT'` | text records | {string\[]} | [`dnsPromises.resolveTxt()`][] | | |
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` | |
is one of the [DNS error codes](). | |
@@ -962,18 +1004,18 @@ records. Each object has a property `type` that indicates the type of the | |
current record. And depending on the `type`, additional properties will be | |
present on the object: | |
-| Type | Properties | | |
-|------|------------| | |
-| `'A'` | `address`/`ttl` | | |
-| `'AAAA'` | `address`/`ttl` | | |
-| `'CNAME'` | `value` | | |
-| `'MX'` | Refer to [`dnsPromises.resolveMx()`][] | | |
-| `'NAPTR'` | Refer to [`dnsPromises.resolveNaptr()`][] | | |
-| `'NS'` | `value` | | |
-| `'PTR'` | `value` | | |
-| `'SOA'` | Refer to [`dnsPromises.resolveSoa()`][] | | |
-| `'SRV'` | Refer to [`dnsPromises.resolveSrv()`][] | | |
-| `'TXT'` | This type of record contains an array property called `entries` which refers to [`dnsPromises.resolveTxt()`][], e.g. `{ entries: ['...'], type: 'TXT' }` | | |
+| Type | Properties | | |
+| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | |
+| `'A'` | `address`/`ttl` | | |
+| `'AAAA'` | `address`/`ttl` | | |
+| `'CNAME'` | `value` | | |
+| `'MX'` | Refer to [`dnsPromises.resolveMx()`][] | | |
+| `'NAPTR'` | Refer to [`dnsPromises.resolveNaptr()`][] | | |
+| `'NS'` | `value` | | |
+| `'PTR'` | `value` | | |
+| `'SOA'` | Refer to [`dnsPromises.resolveSoa()`][] | | |
+| `'SRV'` | Refer to [`dnsPromises.resolveSrv()`][] | | |
+| `'TXT'` | This type of record contains an array property called `entries` which refers to [`dnsPromises.resolveTxt()`][], e.g. `{ entries: ['...'], type: 'TXT' }` | | |
Here is an example of the result object: | |
@@ -1194,7 +1253,7 @@ default dns orders in workers. | |
added: v10.6.0 | |
--> | |
-* `servers` {string[]} array of [RFC 5952][] formatted addresses | |
+* `servers` {string\[]} array of [RFC 5952][] formatted addresses | |
Sets the IP address and port of servers to be used when performing DNS | |
resolution. The `servers` argument is an array of [RFC 5952][] formatted | |
@@ -1217,7 +1276,7 @@ progress. | |
This method works much like | |
[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). | |
That is, if attempting to resolve with the first server provided results in a | |
-`NOTFOUND` error, the `resolve()` method will *not* attempt to resolve with | |
+`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with | |
subsequent servers provided. Fallback DNS servers will only be used if the | |
earlier ones time out or result in some other error. | |
diff --git a/doc/api/errors.md b/doc/api/errors.md | |
index b0b0753f40..a6e3b60bae 100644 | |
--- a/doc/api/errors.md | |
+++ b/doc/api/errors.md | |
@@ -19,7 +19,7 @@ errors: | |
All JavaScript and system errors raised by Node.js inherit from, or are | |
instances of, the standard JavaScript {Error} class and are guaranteed | |
-to provide *at least* the properties available on that class. | |
+to provide _at least_ the properties available on that class. | |
## Error propagation and interception | |
@@ -30,7 +30,7 @@ occur while an application is running. How these errors are reported and | |
handled depends entirely on the type of `Error` and the style of the API that is | |
called. | |
-All JavaScript errors are handled as exceptions that *immediately* generate | |
+All JavaScript errors are handled as exceptions that _immediately_ generate | |
and throw an error using the standard JavaScript `throw` mechanism. These | |
are handled using the [`try…catch` construct][try-catch] provided by the | |
JavaScript language. | |
@@ -46,7 +46,7 @@ try { | |
``` | |
Any use of the JavaScript `throw` mechanism will raise an exception that | |
-*must* be handled using `try…catch` or the Node.js process will exit | |
+_must_ be handled using `try…catch` or the Node.js process will exit | |
immediately. | |
With few exceptions, _Synchronous_ APIs (any blocking method that does not | |
@@ -61,16 +61,17 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways: | |
that should be handled. | |
<!-- eslint-disable no-useless-return --> | |
- ```js | |
- const fs = require('fs'); | |
- fs.readFile('a file that does not exist', (err, data) => { | |
- if (err) { | |
- console.error('There was an error reading the file!', err); | |
- return; | |
- } | |
- // Otherwise handle the data | |
- }); | |
- ``` | |
+ | |
+```js | |
+const fs = require('fs'); | |
+fs.readFile('a file that does not exist', (err, data) => { | |
+ if (err) { | |
+ console.error('There was an error reading the file!', err); | |
+ return; | |
+ } | |
+ // Otherwise handle the data | |
+}); | |
+``` | |
* When an asynchronous method is called on an object that is an | |
[`EventEmitter`][], errors can be routed to that object's `'error'` event. | |
@@ -101,7 +102,7 @@ and [event emitter-based][] APIs, which themselves represent a series of | |
asynchronous operations over time (as opposed to a single operation that may | |
pass or fail). | |
-For *all* [`EventEmitter`][] objects, if an `'error'` event handler is not | |
+For _all_ [`EventEmitter`][] objects, if an `'error'` event handler is not | |
provided, the error will be thrown, causing the Node.js process to report an | |
uncaught exception and crash unless either: The [`domain`][domains] module is | |
used appropriately or a handler has been registered for the | |
@@ -118,8 +119,8 @@ setImmediate(() => { | |
}); | |
``` | |
-Errors generated in this way *cannot* be intercepted using `try…catch` as | |
-they are thrown *after* the calling code has already exited. | |
+Errors generated in this way _cannot_ be intercepted using `try…catch` as | |
+they are thrown _after_ the calling code has already exited. | |
Developers must refer to the documentation for each method to determine | |
exactly how errors raised by those methods are propagated. | |
@@ -199,7 +200,7 @@ provided text message. If an object is passed as `message`, the text message | |
is generated by calling `message.toString()`. The `error.stack` property will | |
represent the point in the code at which `new Error()` was called. Stack traces | |
are dependent on [V8's stack trace API][]. Stack traces extend only to either | |
-(a) the beginning of *synchronous code execution*, or (b) the number of frames | |
+(a) the beginning of _synchronous code execution_, or (b) the number of frames | |
given by the property `Error.stackTraceLimit`, whichever is smaller. | |
### `Error.captureStackTrace(targetObject[, constructorOpt])` | |
@@ -247,7 +248,7 @@ collected by a stack trace (whether generated by `new Error().stack` or | |
`Error.captureStackTrace(obj)`). | |
The default value is `10` but may be set to any valid JavaScript number. Changes | |
-will affect any stack trace captured *after* the value has been changed. | |
+will affect any stack trace captured _after_ the value has been changed. | |
If set to a non-number value, or set to a negative number, stack traces will | |
not capture any frames. | |
@@ -269,7 +270,7 @@ about specific codes. | |
The `error.message` property is the string description of the error as set by | |
calling `new Error(message)`. The `message` passed to the constructor will also | |
appear in the first line of the stack trace of the `Error`, however changing | |
-this property after the `Error` object is created *may not* change the first | |
+this property after the `Error` object is created _may not_ change the first | |
line of the stack trace (for example, when `error.stack` is read before this | |
property is changed). | |
@@ -341,7 +342,7 @@ The location information will be one of: | |
* `native`, if the frame represents a call internal to V8 (as in `[].forEach`). | |
* `plain-filename.js:line:column`, if the frame represents a call internal | |
- to Node.js. | |
+ to Node.js. | |
* `/absolute/path/to/file.js:line:column`, if the frame represents a call in | |
a user program, or its dependencies. | |
@@ -372,7 +373,7 @@ require('net').connect(-1); | |
// Throws "RangeError: "port" option should be >= 0 and < 65536: -1" | |
``` | |
-Node.js will generate and throw `RangeError` instances *immediately* as a form | |
+Node.js will generate and throw `RangeError` instances _immediately_ as a form | |
of argument validation. | |
## Class: `ReferenceError` | |
@@ -570,7 +571,7 @@ require('url').parse(() => { }); | |
// Throws TypeError, since it expected a string. | |
``` | |
-Node.js will generate and throw `TypeError` instances *immediately* as a form | |
+Node.js will generate and throw `TypeError` instances _immediately_ as a form | |
of argument validation. | |
## Exceptions vs. errors | |
@@ -580,11 +581,11 @@ of argument validation. | |
A JavaScript exception is a value that is thrown as a result of an invalid | |
operation or as the target of a `throw` statement. While it is not required | |
that these values are instances of `Error` or classes which inherit from | |
-`Error`, all exceptions thrown by Node.js or the JavaScript runtime *will* be | |
+`Error`, all exceptions thrown by Node.js or the JavaScript runtime _will_ be | |
instances of `Error`. | |
-Some exceptions are *unrecoverable* at the JavaScript layer. Such exceptions | |
-will *always* cause the Node.js process to crash. Examples include `assert()` | |
+Some exceptions are _unrecoverable_ at the JavaScript layer. Such exceptions | |
+will _always_ cause the Node.js process to crash. Examples include `assert()` | |
checks or `abort()` calls in the C++ layer. | |
## OpenSSL errors | |
@@ -2071,12 +2333,13 @@ object. | |
An attempt was made to `require()` an [ES Module][]. | |
<a id="ERR_SCRIPT_EXECUTION_INTERRUPTED"></a> | |
+ | |
### `ERR_SCRIPT_EXECUTION_INTERRUPTED` | |
-Script execution was interrupted by `SIGINT` (For example, | |
-<kbd>Ctrl</kbd>+<kbd>C</kbd> was pressed.) | |
+Script execution was interrupted by `SIGINT` (For example, <kbd>Ctrl</kbd>+<kbd>C</kbd> was pressed.) | |
<a id="ERR_SCRIPT_EXECUTION_TIMEOUT"></a> | |
+ | |
### `ERR_SCRIPT_EXECUTION_TIMEOUT` | |
Script execution timed out, possibly due to bugs in the script being executed. | |
@@ -2634,7 +2992,7 @@ added: v9.0.0 | |
removed: v10.0.0 | |
--> | |
-HTTP/2 informational headers must only be sent *prior* to calling the | |
+HTTP/2 informational headers must only be sent _prior_ to calling the | |
`Http2Stream.prototype.respond()` method. | |
<a id="ERR_HTTP2_STREAM_CLOSED"></a> | |
diff --git a/doc/api/esm.md b/doc/api/esm.md | |
index 4455054aa8..4bfa22c111 100644 | |
--- a/doc/api/esm.md | |
+++ b/doc/api/esm.md | |
@@ -83,9 +83,8 @@ provides interoperability between them and its original module format, | |
[CommonJS][]. | |
<!-- Anchors to make sure old links find a target --> | |
-<i id="esm_package_json_type_field"></i> | |
-<i id="esm_package_scope_and_file_extensions"></i> | |
-<i id="esm_input_type_flag"></i> | |
+ | |
+<i id="esm_package_json_type_field"></i> <i id="esm_package_scope_and_file_extensions"></i> <i id="esm_input_type_flag"></i> | |
## Enabling | |
@@ -99,20 +98,8 @@ via the `.mjs` file extension, the `package.json` [`"type"`][] field, or the | |
details. | |
<!-- Anchors to make sure old links find a target --> | |
-<i id="esm_package_entry_points"></i> | |
-<i id="esm_main_entry_point_export"></i> | |
-<i id="esm_subpath_exports"></i> | |
-<i id="esm_package_exports_fallbacks"></i> | |
-<i id="esm_exports_sugar"></i> | |
-<i id="esm_conditional_exports"></i> | |
-<i id="esm_nested_conditions"></i> | |
-<i id="esm_self_referencing_a_package_using_its_name"></i> | |
-<i id="esm_internal_package_imports"></i> | |
-<i id="esm_dual_commonjs_es_module_packages"></i> | |
-<i id="esm_dual_package_hazard"></i> | |
-<i id="esm_writing_dual_packages_while_avoiding_or_minimizing_hazards"></i> | |
-<i id="esm_approach_1_use_an_es_module_wrapper"></i> | |
-<i id="esm_approach_2_isolate_state"></i> | |
+ | |
+<i id="esm_package_entry_points"></i> <i id="esm_main_entry_point_export"></i> <i id="esm_subpath_exports"></i> <i id="esm_package_exports_fallbacks"></i> <i id="esm_exports_sugar"></i> <i id="esm_conditional_exports"></i> <i id="esm_nested_conditions"></i> <i id="esm_self_referencing_a_package_using_its_name"></i> <i id="esm_internal_package_imports"></i> <i id="esm_dual_commonjs_es_module_packages"></i> <i id="esm_dual_package_hazard"></i> <i id="esm_writing_dual_packages_while_avoiding_or_minimizing_hazards"></i> <i id="esm_approach_1_use_an_es_module_wrapper"></i> <i id="esm_approach_2_isolate_state"></i> | |
## Packages | |
@@ -616,7 +612,7 @@ CommonJS modules loaded. | |
* `specifier` {string} | |
* `context` {Object} | |
- * `conditions` {string[]} | |
+ * `conditions` {string\[]} | |
* `parentURL` {string|undefined} | |
* `defaultResolve` {Function} The Node.js default resolver. | |
* Returns: {Object} | |
@@ -1025,16 +1021,16 @@ The resolver has the following properties: | |
* Relative and absolute URL resolution | |
* No default extensions | |
* No folder mains | |
-* Bare specifier package resolution lookup through node_modules | |
+* Bare specifier package resolution lookup through node\_modules | |
### Resolver algorithm | |
The algorithm to load an ES module specifier is given through the | |
-**ESM_RESOLVE** method below. It returns the resolved URL for a | |
+**ESM\_RESOLVE** method below. It returns the resolved URL for a | |
module specifier relative to a parentURL. | |
The algorithm to determine the module format of a resolved URL is | |
-provided by **ESM_FORMAT**, which returns the unique module | |
+provided by **ESM\_FORMAT**, which returns the unique module | |
format for any file. The _"module"_ format is returned for an ECMAScript | |
Module, while the _"commonjs"_ format is used to indicate loading through the | |
legacy CommonJS loader. Additional formats such as _"addon"_ can be extended in | |
@@ -1062,261 +1059,263 @@ The resolver can throw the following errors: | |
### Resolver Algorithm Specification | |
-**ESM_RESOLVE**(_specifier_, _parentURL_) | |
+**ESM\_RESOLVE**(_specifier_, _parentURL_) | |
> 1. Let _resolved_ be **undefined**. | |
-> 1. If _specifier_ is a valid URL, then | |
+> 2. If _specifier_ is a valid URL, then | |
> 1. Set _resolved_ to the result of parsing and reserializing | |
> _specifier_ as a URL. | |
-> 1. Otherwise, if _specifier_ starts with _"/"_, _"./"_ or _"../"_, then | |
+> 3. Otherwise, if _specifier_ starts with _"/"_, _"./"_ or _"../"_, then | |
> 1. Set _resolved_ to the URL resolution of _specifier_ relative to | |
> _parentURL_. | |
-> 1. Otherwise, if _specifier_ starts with _"#"_, then | |
-> 1. Set _resolved_ to the result of **PACKAGE_IMPORTS_RESOLVE**(_specifier_, | |
+> 4. Otherwise, if _specifier_ starts with _"#"_, then | |
+> 1. Set _resolved_ to the result of | |
+> **PACKAGE\_IMPORTS\_RESOLVE**(_specifier_, | |
> _parentURL_, _defaultConditions_). | |
-> 1. Otherwise, | |
+> 5. Otherwise, | |
> 1. Note: _specifier_ is now a bare specifier. | |
-> 1. Set _resolved_ the result of | |
-> **PACKAGE_RESOLVE**(_specifier_, _parentURL_). | |
-> 1. If _resolved_ contains any percent encodings of _"/"_ or _"\\"_ (_"%2f"_ | |
+> 2. Set _resolved_ the result of | |
+> **PACKAGE\_RESOLVE**(_specifier_, _parentURL_). | |
+> 6. If _resolved_ contains any percent encodings of _"/"_ or _"\\"_ (_"%2f"_ | |
> and _"%5C"_ respectively), then | |
> 1. Throw an _Invalid Module Specifier_ error. | |
-> 1. If the file at _resolved_ is a directory, then | |
+> 7. If the file at _resolved_ is a directory, then | |
> 1. Throw an _Unsupported Directory Import_ error. | |
-> 1. If the file at _resolved_ does not exist, then | |
+> 8. If the file at _resolved_ does not exist, then | |
> 1. Throw a _Module Not Found_ error. | |
-> 1. Set _resolved_ to the real path of _resolved_. | |
-> 1. Let _format_ be the result of **ESM_FORMAT**(_resolved_). | |
-> 1. Load _resolved_ as module format, _format_. | |
-> 1. Return _resolved_. | |
+> 9. Set _resolved_ to the real path of _resolved_. | |
+> 10. Let _format_ be the result of **ESM\_FORMAT**(_resolved_). | |
+> 11. Load _resolved_ as module format, _format_. | |
+> 12. Return _resolved_. | |
-**PACKAGE_RESOLVE**(_packageSpecifier_, _parentURL_) | |
+**PACKAGE\_RESOLVE**(_packageSpecifier_, _parentURL_) | |
> 1. Let _packageName_ be **undefined**. | |
-> 1. If _packageSpecifier_ is an empty string, then | |
+> 2. If _packageSpecifier_ is an empty string, then | |
> 1. Throw an _Invalid Module Specifier_ error. | |
-> 1. If _packageSpecifier_ does not start with _"@"_, then | |
+> 3. If _packageSpecifier_ does not start with _"@"_, then | |
> 1. Set _packageName_ to the substring of _packageSpecifier_ until the first | |
> _"/"_ separator or the end of the string. | |
-> 1. Otherwise, | |
+> 4. Otherwise, | |
> 1. If _packageSpecifier_ does not contain a _"/"_ separator, then | |
> 1. Throw an _Invalid Module Specifier_ error. | |
-> 1. Set _packageName_ to the substring of _packageSpecifier_ | |
+> 2. Set _packageName_ to the substring of _packageSpecifier_ | |
> until the second _"/"_ separator or the end of the string. | |
-> 1. If _packageName_ starts with _"."_ or contains _"\\"_ or _"%"_, then | |
+> 5. If _packageName_ starts with _"."_ or contains _"\\"_ or _"%"_, then | |
> 1. Throw an _Invalid Module Specifier_ error. | |
-> 1. Let _packageSubpath_ be _"."_ concatenated with the substring of | |
+> 6. Let _packageSubpath_ be _"."_ concatenated with the substring of | |
> _packageSpecifier_ from the position at the length of _packageName_. | |
-> 1. If _packageSubpath_ ends in _"/"_, then | |
+> 7. If _packageSubpath_ ends in _"/"_, then | |
> 1. Throw an _Invalid Module Specifier_ error. | |
-> 1. Let _selfUrl_ be the result of | |
-> **PACKAGE_SELF_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_). | |
-> 1. If _selfUrl_ is not **undefined**, return _selfUrl_. | |
-> 1. If _packageSubpath_ is _"."_ and _packageName_ is a Node.js builtin | |
-> module, then | |
-> 1. Return the string _"node:"_ concatenated with _packageSpecifier_. | |
-> 1. While _parentURL_ is not the file system root, | |
-> 1. Let _packageURL_ be the URL resolution of _"node_modules/"_ | |
-> concatenated with _packageSpecifier_, relative to _parentURL_. | |
-> 1. Set _parentURL_ to the parent folder URL of _parentURL_. | |
-> 1. If the folder at _packageURL_ does not exist, then | |
-> 1. Continue the next loop iteration. | |
-> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). | |
-> 1. If _pjson_ is not **null** and _pjson_._exports_ is not **null** or | |
-> **undefined**, then | |
-> 1. Return the result of **PACKAGE_EXPORTS_RESOLVE**(_packageURL_, | |
-> _packageSubpath_, _pjson.exports_, _defaultConditions_). | |
-> 1. Otherwise, if _packageSubpath_ is equal to _"."_, then | |
-> 1. If _pjson.main_ is a string, then | |
-> 1. Return the URL resolution of _main_ in _packageURL_. | |
-> 1. Otherwise, | |
-> 1. Return the URL resolution of _packageSubpath_ in _packageURL_. | |
-> 1. Throw a _Module Not Found_ error. | |
- | |
-**PACKAGE_SELF_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_) | |
- | |
-> 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_). | |
-> 1. If _packageURL_ is **null**, then | |
+> 8. Let _selfUrl_ be the result of | |
+> **PACKAGE\_SELF\_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_). | |
+> 9. If _selfUrl_ is not **undefined**, return _selfUrl_. | |
+> 10. If _packageSubpath_ is _"."_ and _packageName_ is a Node.js builtin | |
+> module, then | |
+> 1. Return the string _"node:"_ concatenated with _packageSpecifier_. | |
+> 11. While _parentURL_ is not the file system root, | |
+> 1. Let _packageURL_ be the URL resolution of _"node\_modules/"_ | |
+> concatenated with _packageSpecifier_, relative to _parentURL_. | |
+> 2. Set _parentURL_ to the parent folder URL of _parentURL_. | |
+> 3. If the folder at _packageURL_ does not exist, then | |
+> 1. Continue the next loop iteration. | |
+> 4. Let _pjson_ be the result of **READ\_PACKAGE\_JSON**(_packageURL_). | |
+> 5. If _pjson_ is not **null** and _pjson_._exports_ is not **null** or | |
+> **undefined**, then | |
+> 1. Return the result of **PACKAGE\_EXPORTS\_RESOLVE**(_packageURL_, | |
+> _packageSubpath_, _pjson.exports_, _defaultConditions_). | |
+> 6. Otherwise, if _packageSubpath_ is equal to _"."_, then | |
+> 1. If _pjson.main_ is a string, then | |
+> 1. Return the URL resolution of _main_ in _packageURL_. | |
+> 7. Otherwise, | |
+> 1. Return the URL resolution of _packageSubpath_ in _packageURL_. | |
+> 12. Throw a _Module Not Found_ error. | |
+ | |
+**PACKAGE\_SELF\_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_) | |
+ | |
+> 1. Let _packageURL_ be the result of **READ\_PACKAGE\_SCOPE**(_parentURL_). | |
+> 2. If _packageURL_ is **null**, then | |
> 1. Return **undefined**. | |
-> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). | |
-> 1. If _pjson_ is **null** or if _pjson_._exports_ is **null** or | |
+> 3. Let _pjson_ be the result of **READ\_PACKAGE\_JSON**(_packageURL_). | |
+> 4. If _pjson_ is **null** or if _pjson_._exports_ is **null** or | |
> **undefined**, then | |
> 1. Return **undefined**. | |
-> 1. If _pjson.name_ is equal to _packageName_, then | |
-> 1. Return the result of **PACKAGE_EXPORTS_RESOLVE**(_packageURL_, | |
+> 5. If _pjson.name_ is equal to _packageName_, then | |
+> 1. Return the result of **PACKAGE\_EXPORTS\_RESOLVE**(_packageURL_, | |
> _packageSubpath_, _pjson.exports_, _defaultConditions_). | |
-> 1. Otherwise, return **undefined**. | |
+> 6. Otherwise, return **undefined**. | |
-**PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_) | |
+**PACKAGE\_EXPORTS\_RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_) | |
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not | |
> starting with _"."_, throw an _Invalid Package Configuration_ error. | |
-> 1. If _subpath_ is equal to _"."_, then | |
+> 2. If _subpath_ is equal to _"."_, then | |
> 1. Let _mainExport_ be **undefined**. | |
-> 1. If _exports_ is a String or Array, or an Object containing no keys | |
+> 2. If _exports_ is a String or Array, or an Object containing no keys | |
> starting with _"."_, then | |
> 1. Set _mainExport_ to _exports_. | |
-> 1. Otherwise if _exports_ is an Object containing a _"."_ property, then | |
-> 1. Set _mainExport_ to _exports_\[_"."_\]. | |
-> 1. If _mainExport_ is not **undefined**, then | |
-> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( | |
+> 3. Otherwise if _exports_ is an Object containing a _"."_ property, then | |
+> 1. Set _mainExport_ to _exports_\[_"."_]. | |
+> 4. If _mainExport_ is not **undefined**, then | |
+> 1. Let _resolved_ be the result of **PACKAGE\_TARGET\_RESOLVE**( | |
> _packageURL_, _mainExport_, _""_, **false**, **false**, | |
> _conditions_). | |
-> 1. If _resolved_ is not **null** or **undefined**, return _resolved_. | |
-> 1. Otherwise, if _exports_ is an Object and all keys of _exports_ start with | |
+> 2. If _resolved_ is not **null** or **undefined**, return _resolved_. | |
+> 3. Otherwise, if _exports_ is an Object and all keys of _exports_ start with | |
> _"."_, then | |
> 1. Let _matchKey_ be the string _"./"_ concatenated with _subpath_. | |
-> 1. Let _resolved_ be the result of **PACKAGE_IMPORTS_EXPORTS_RESOLVE**( | |
+> 2. Let _resolved_ be the result of **PACKAGE\_IMPORTS\_EXPORTS\_RESOLVE**( | |
> _matchKey_, _exports_, _packageURL_, **false**, _conditions_). | |
-> 1. If _resolved_ is not **null** or **undefined**, return _resolved_. | |
-> 1. Throw a _Package Path Not Exported_ error. | |
+> 3. If _resolved_ is not **null** or **undefined**, return _resolved_. | |
+> 4. Throw a _Package Path Not Exported_ error. | |
-**PACKAGE_IMPORTS_RESOLVE**(_specifier_, _parentURL_, _conditions_) | |
+**PACKAGE\_IMPORTS\_RESOLVE**(_specifier_, _parentURL_, _conditions_) | |
> 1. Assert: _specifier_ begins with _"#"_. | |
-> 1. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then | |
+> 2. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then | |
> 1. Throw an _Invalid Module Specifier_ error. | |
-> 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_). | |
-> 1. If _packageURL_ is not **null**, then | |
-> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). | |
-> 1. If _pjson.imports_ is a non-null Object, then | |
-> 1. Let _resolved_ be the result of **PACKAGE_IMPORTS_EXPORTS_RESOLVE**( | |
+> 3. Let _packageURL_ be the result of **READ\_PACKAGE\_SCOPE**(_parentURL_). | |
+> 4. If _packageURL_ is not **null**, then | |
+> 1. Let _pjson_ be the result of **READ\_PACKAGE\_JSON**(_packageURL_). | |
+> 2. If _pjson.imports_ is a non-null Object, then | |
+> 1. Let _resolved_ be the result of | |
+> **PACKAGE\_IMPORTS\_EXPORTS\_RESOLVE**( | |
> _specifier_, _pjson.imports_, _packageURL_, **true**, _conditions_). | |
-> 1. If _resolved_ is not **null** or **undefined**, return _resolved_. | |
-> 1. Throw a _Package Import Not Defined_ error. | |
+> 2. If _resolved_ is not **null** or **undefined**, return _resolved_. | |
+> 5. Throw a _Package Import Not Defined_ error. | |
-**PACKAGE_IMPORTS_EXPORTS_RESOLVE**(_matchKey_, _matchObj_, _packageURL_, | |
+**PACKAGE\_IMPORTS\_EXPORTS\_RESOLVE**(_matchKey_, _matchObj_, _packageURL_, | |
_isImports_, _conditions_) | |
-> 1. If _matchKey_ is a key of _matchObj_ and does not contain _"*"_, then | |
-> 1. Let _target_ be the value of _matchObj_\[_matchKey_\]. | |
-> 1. Return the result of **PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, | |
-> _""_, **false**, _isImports_, _conditions_). | |
-> 1. Let _expansionKeys_ be the list of keys of _matchObj_ containing only a | |
-> single _"*"_, sorted by the sorting function **PATTERN_KEY_COMPARE** which | |
-> orders in descending order of specificity. | |
-> 1. For each key _expansionKey_ in _expansionKeys_, do | |
+> 1. If _matchKey_ is a key of _matchObj_ and does not contain _"\*"_, then | |
+> 1. Let _target_ be the value of _matchObj_\[_matchKey_]. | |
+> 2. Return the result of **PACKAGE\_TARGET\_RESOLVE**(_packageURL_, | |
+> _target_, _""_, **false**, _isImports_, _conditions_). | |
+> 2. Let _expansionKeys_ be the list of keys of _matchObj_ containing only a | |
+> single _"\*"_, sorted by the sorting function **PATTERN\_KEY\_COMPARE** | |
+> which orders in descending order of specificity. | |
+> 3. For each key _expansionKey_ in _expansionKeys_, do | |
> 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding | |
-> the first _"*"_ character. | |
-> 1. If _matchKey_ starts with but is not equal to _patternBase_, then | |
+> the first _"\*"_ character. | |
+> 2. If _matchKey_ starts with but is not equal to _patternBase_, then | |
> 1. Let _patternTrailer_ be the substring of _expansionKey_ from the | |
-> index after the first _"*"_ character. | |
-> 1. If _patternTrailer_ has zero length, or if _matchKey_ ends with | |
+> index after the first _"\*"_ character. | |
+> 2. If _patternTrailer_ has zero length, or if _matchKey_ ends with | |
> _patternTrailer_ and the length of _matchKey_ is greater than or | |
> equal to the length of _expansionKey_, then | |
-> 1. Let _target_ be the value of _matchObj_\[_expansionKey_\]. | |
-> 1. Let _subpath_ be the substring of _matchKey_ starting at the | |
+> 1. Let _target_ be the value of _matchObj_\[_expansionKey_]. | |
+> 2. Let _subpath_ be the substring of _matchKey_ starting at the | |
> index of the length of _patternBase_ up to the length of | |
> _matchKey_ minus the length of _patternTrailer_. | |
-> 1. Return the result of **PACKAGE_TARGET_RESOLVE**(_packageURL_, | |
+> 3. Return the result of **PACKAGE\_TARGET\_RESOLVE**(_packageURL_, | |
> _target_, _subpath_, **true**, _isImports_, _conditions_). | |
-> 1. Return **null**. | |
- | |
-**PATTERN_KEY_COMPARE**(_keyA_, _keyB_) | |
- | |
-> 1. Assert: _keyA_ ends with _"/"_ or contains only a single _"*"_. | |
-> 1. Assert: _keyB_ ends with _"/"_ or contains only a single _"*"_. | |
-> 1. Let _baseLengthA_ be the index of _"*"_ in _keyA_ plus one, if _keyA_ | |
-> contains _"*"_, or the length of _keyA_ otherwise. | |
-> 1. Let _baseLengthB_ be the index of _"*"_ in _keyB_ plus one, if _keyB_ | |
-> contains _"*"_, or the length of _keyB_ otherwise. | |
-> 1. If _baseLengthA_ is greater than _baseLengthB_, return -1. | |
-> 1. If _baseLengthB_ is greater than _baseLengthA_, return 1. | |
-> 1. If _keyA_ does not contain _"*"_, return 1. | |
-> 1. If _keyB_ does not contain _"*"_, return -1. | |
-> 1. If the length of _keyA_ is greater than the length of _keyB_, return -1. | |
-> 1. If the length of _keyB_ is greater than the length of _keyA_, return 1. | |
-> 1. Return 0. | |
- | |
-**PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, _subpath_, _pattern_, | |
+> 4. Return **null**. | |
+ | |
+**PATTERN\_KEY\_COMPARE**(_keyA_, _keyB_) | |
+ | |
+> 1. Assert: _keyA_ ends with _"/"_ or contains only a single _"\*"_. | |
+> 2. Assert: _keyB_ ends with _"/"_ or contains only a single _"\*"_. | |
+> 3. Let _baseLengthA_ be the index of _"\*"_ in _keyA_ plus one, if _keyA_ | |
+> contains _"\*"_, or the length of _keyA_ otherwise. | |
+> 4. Let _baseLengthB_ be the index of _"\*"_ in _keyB_ plus one, if _keyB_ | |
+> contains _"\*"_, or the length of _keyB_ otherwise. | |
+> 5. If _baseLengthA_ is greater than _baseLengthB_, return -1. | |
+> 6. If _baseLengthB_ is greater than _baseLengthA_, return 1. | |
+> 7. If _keyA_ does not contain _"\*"_, return 1. | |
+> 8. If _keyB_ does not contain _"\*"_, return -1. | |
+> 9. If the length of _keyA_ is greater than the length of _keyB_, return -1. | |
+> 10. If the length of _keyB_ is greater than the length of _keyA_, return 1. | |
+> 11. Return 0. | |
+ | |
+**PACKAGE\_TARGET\_RESOLVE**(_packageURL_, _target_, _subpath_, _pattern_, | |
_internal_, _conditions_) | |
> 1. If _target_ is a String, then | |
> 1. If _pattern_ is **false**, _subpath_ has non-zero length and _target_ | |
> does not end with _"/"_, throw an _Invalid Module Specifier_ error. | |
-> 1. If _target_ does not start with _"./"_, then | |
+> 2. If _target_ does not start with _"./"_, then | |
> 1. If _internal_ is **true** and _target_ does not start with _"../"_ or | |
> _"/"_ and is not a valid URL, then | |
> 1. If _pattern_ is **true**, then | |
-> 1. Return **PACKAGE_RESOLVE**(_target_ with every instance of | |
-> _"*"_ replaced by _subpath_, _packageURL_ + _"/"_)_. | |
-> 1. Return **PACKAGE_RESOLVE**(_target_ + _subpath_, | |
-> _packageURL_ + _"/"_)_. | |
-> 1. Otherwise, throw an _Invalid Package Target_ error. | |
-> 1. If _target_ split on _"/"_ or _"\\"_ contains any _"."_, _".."_ or | |
-> _"node_modules"_ segments after the first segment, throw an | |
+> 1. Return **PACKAGE\_RESOLVE**(_target_ with every instance of | |
+> _"\*"_ replaced by _subpath_, _packageURL_ + _"/"_)\_. | |
+> 2. Return **PACKAGE\_RESOLVE**(_target_ + _subpath_, | |
+> _packageURL_ + _"/"_)\_. | |
+> 2. Otherwise, throw an _Invalid Package Target_ error. | |
+> 3. If _target_ split on _"/"_ or _"\\"_ contains any _"."_, _".."_ or | |
+> _"node\_modules"_ segments after the first segment, throw an | |
> _Invalid Package Target_ error. | |
-> 1. Let _resolvedTarget_ be the URL resolution of the concatenation of | |
+> 4. Let _resolvedTarget_ be the URL resolution of the concatenation of | |
> _packageURL_ and _target_. | |
-> 1. Assert: _resolvedTarget_ is contained in _packageURL_. | |
-> 1. If _subpath_ split on _"/"_ or _"\\"_ contains any _"."_, _".."_ or | |
-> _"node_modules"_ segments, throw an _Invalid Module Specifier_ error. | |
-> 1. If _pattern_ is **true**, then | |
+> 5. Assert: _resolvedTarget_ is contained in _packageURL_. | |
+> 6. If _subpath_ split on _"/"_ or _"\\"_ contains any _"."_, _".."_ or | |
+> _"node\_modules"_ segments, throw an _Invalid Module Specifier_ error. | |
+> 7. If _pattern_ is **true**, then | |
> 1. Return the URL resolution of _resolvedTarget_ with every instance of | |
-> _"*"_ replaced with _subpath_. | |
-> 1. Otherwise, | |
+> _"\*"_ replaced with _subpath_. | |
+> 8. Otherwise, | |
> 1. Return the URL resolution of the concatenation of _subpath_ and | |
> _resolvedTarget_. | |
-> 1. Otherwise, if _target_ is a non-null Object, then | |
+> 2. Otherwise, if _target_ is a non-null Object, then | |
> 1. If _exports_ contains any index property keys, as defined in ECMA-262 | |
> [6.1.7 Array Index][], throw an _Invalid Package Configuration_ error. | |
-> 1. For each property _p_ of _target_, in object insertion order as, | |
+> 2. For each property _p_ of _target_, in object insertion order as, | |
> 1. If _p_ equals _"default"_ or _conditions_ contains an entry for _p_, | |
> then | |
> 1. Let _targetValue_ be the value of the _p_ property in _target_. | |
-> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( | |
+> 2. Let _resolved_ be the result of **PACKAGE\_TARGET\_RESOLVE**( | |
> _packageURL_, _targetValue_, _subpath_, _pattern_, _internal_, | |
> _conditions_). | |
-> 1. If _resolved_ is equal to **undefined**, continue the loop. | |
-> 1. Return _resolved_. | |
-> 1. Return **undefined**. | |
-> 1. Otherwise, if _target_ is an Array, then | |
-> 1. If _target.length is zero, return **null**. | |
-> 1. For each item _targetValue_ in _target_, do | |
-> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( | |
+> 3. If _resolved_ is equal to **undefined**, continue the loop. | |
+> 4. Return _resolved_. | |
+> 3. Return **undefined**. | |
+> 3. Otherwise, if _target_ is an Array, then | |
+> 1. If \_target.length is zero, return **null**. | |
+> 2. For each item _targetValue_ in _target_, do | |
+> 1. Let _resolved_ be the result of **PACKAGE\_TARGET\_RESOLVE**( | |
> _packageURL_, _targetValue_, _subpath_, _pattern_, _internal_, | |
> _conditions_), continuing the loop on any _Invalid Package Target_ | |
> error. | |
-> 1. If _resolved_ is **undefined**, continue the loop. | |
-> 1. Return _resolved_. | |
-> 1. Return or throw the last fallback resolution **null** return or error. | |
-> 1. Otherwise, if _target_ is _null_, return **null**. | |
-> 1. Otherwise throw an _Invalid Package Target_ error. | |
+> 2. If _resolved_ is **undefined**, continue the loop. | |
+> 3. Return _resolved_. | |
+> 3. Return or throw the last fallback resolution **null** return or error. | |
+> 4. Otherwise, if _target_ is _null_, return **null**. | |
+> 5. Otherwise throw an _Invalid Package Target_ error. | |
-**ESM_FORMAT**(_url_) | |
+**ESM\_FORMAT**(_url_) | |
> 1. Assert: _url_ corresponds to an existing file. | |
-> 1. Let _pjson_ be the result of **READ_PACKAGE_SCOPE**(_url_). | |
-> 1. If _url_ ends in _".mjs"_, then | |
+> 2. Let _pjson_ be the result of **READ\_PACKAGE\_SCOPE**(_url_). | |
+> 3. If _url_ ends in _".mjs"_, then | |
> 1. Return _"module"_. | |
-> 1. If _url_ ends in _".cjs"_, then | |
+> 4. If _url_ ends in _".cjs"_, then | |
> 1. Return _"commonjs"_. | |
-> 1. If _pjson?.type_ exists and is _"module"_, then | |
+> 5. If _pjson?.type_ exists and is _"module"_, then | |
> 1. If _url_ ends in _".js"_, then | |
> 1. Return _"module"_. | |
-> 1. Throw an _Unsupported File Extension_ error. | |
-> 1. Otherwise, | |
+> 2. Throw an _Unsupported File Extension_ error. | |
+> 6. Otherwise, | |
> 1. Throw an _Unsupported File Extension_ error. | |
-**READ_PACKAGE_SCOPE**(_url_) | |
+**READ\_PACKAGE\_SCOPE**(_url_) | |
> 1. Let _scopeURL_ be _url_. | |
-> 1. While _scopeURL_ is not the file system root, | |
+> 2. While _scopeURL_ is not the file system root, | |
> 1. Set _scopeURL_ to the parent URL of _scopeURL_. | |
-> 1. If _scopeURL_ ends in a _"node_modules"_ path segment, return **null**. | |
-> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_scopeURL_). | |
-> 1. If _pjson_ is not **null**, then | |
+> 2. If _scopeURL_ ends in a _"node\_modules"_ path segment, return **null**. | |
+> 3. Let _pjson_ be the result of **READ\_PACKAGE\_JSON**(_scopeURL_). | |
+> 4. If _pjson_ is not **null**, then | |
> 1. Return _pjson_. | |
-> 1. Return **null**. | |
+> 3. Return **null**. | |
-**READ_PACKAGE_JSON**(_packageURL_) | |
+**READ\_PACKAGE\_JSON**(_packageURL_) | |
> 1. Let _pjsonURL_ be the resolution of _"package.json"_ within _packageURL_. | |
-> 1. If the file at _pjsonURL_ does not exist, then | |
+> 2. If the file at _pjsonURL_ does not exist, then | |
> 1. Return **null**. | |
-> 1. If the file at _packageURL_ does not parse as valid JSON, then | |
+> 3. If the file at _packageURL_ does not parse as valid JSON, then | |
> 1. Throw an _Invalid Package Configuration_ error. | |
-> 1. Return the parsed JSON source of the file at _pjsonURL_. | |
+> 4. Return the parsed JSON source of the file at _pjsonURL_. | |
### Customizing ESM specifier resolution algorithm | |
diff --git a/doc/api/events.md b/doc/api/events.md | |
index 5d34a311cf..f3ef831a48 100644 | |
--- a/doc/api/events.md | |
+++ b/doc/api/events.md | |
@@ -113,7 +113,7 @@ myEmitter.emit('event'); | |
Using the `eventEmitter.once()` method, it is possible to register a listener | |
that is called at most once for a particular event. Once the event is emitted, | |
-the listener is unregistered and *then* called. | |
+the listener is unregistered and _then_ called. | |
```js | |
const myEmitter = new MyEmitter(); | |
@@ -259,15 +261,15 @@ added: v0.1.26 | |
* `eventName` {string|symbol} The name of the event being listened for | |
* `listener` {Function} The event handler function | |
-The `EventEmitter` instance will emit its own `'newListener'` event *before* | |
+The `EventEmitter` instance will emit its own `'newListener'` event _before_ | |
a listener is added to its internal array of listeners. | |
Listeners registered for the `'newListener'` event are passed the event | |
name and a reference to the listener being added. | |
The fact that the event is triggered before adding the listener has a subtle | |
-but important side effect: any *additional* listeners registered to the same | |
-`name` *within* the `'newListener'` callback are inserted *before* the | |
+but important side effect: any _additional_ listeners registered to the same | |
+`name` _within_ the `'newListener'` callback are inserted _before_ the | |
listener that is in the process of being added. | |
```js | |
@@ -307,9 +310,10 @@ changes: | |
* `eventName` {string|symbol} The event name | |
* `listener` {Function} The event handler function | |
-The `'removeListener'` event is emitted *after* the `listener` is removed. | |
+The `'removeListener'` event is emitted _after_ the `listener` is removed. | |
### `emitter.addListener(eventName, listener)` | |
+ | |
<!-- YAML | |
added: v0.1.26 | |
--> | |
@@ -422,7 +431,7 @@ changes: | |
--> | |
* `eventName` {string|symbol} | |
-* Returns: {Function[]} | |
+* Returns: {Function\[]} | |
Returns a copy of the array of listeners for the event named `eventName`. | |
@@ -525,7 +538,7 @@ added: v6.0.0 | |
* `listener` {Function} The callback function | |
* Returns: {EventEmitter} | |
-Adds the `listener` function to the *beginning* of the listeners array for the | |
+Adds the `listener` function to the _beginning_ of the listeners array for the | |
event named `eventName`. No checks are made to see if the `listener` has | |
already been added. Multiple calls passing the same combination of `eventName` | |
and `listener` will result in the `listener` being added, and called, multiple | |
@@ -549,7 +563,7 @@ added: v6.0.0 | |
* Returns: {EventEmitter} | |
Adds a **one-time** `listener` function for the event named `eventName` to the | |
-*beginning* of the listeners array. The next time `eventName` is triggered, this | |
+_beginning_ of the listeners array. The next time `eventName` is triggered, this | |
listener is removed, and then invoked. | |
```js | |
@@ -604,8 +620,8 @@ called multiple times to remove each instance. | |
Once an event is emitted, all listeners attached to it at the | |
time of emitting are called in order. This implies that any | |
-`removeListener()` or `removeAllListeners()` calls *after* emitting and | |
-*before* the last listener finishes execution will not remove them from | |
+`removeListener()` or `removeAllListeners()` calls _after_ emitting and | |
+_before_ the last listener finishes execution will not remove them from | |
`emit()` in progress. Subsequent events behave as expected. | |
```js | |
@@ -639,7 +655,7 @@ myEmitter.emit('event'); | |
``` | |
Because listeners are managed using an internal array, calling this will | |
-change the position indices of any listener registered *after* the listener | |
+change the position indices of any listener registered _after_ the listener | |
being removed. This will not impact the order in which listeners are called, | |
but it means that any copies of the listener array as returned by | |
the `emitter.listeners()` method will need to be recreated. | |
@@ -688,7 +706,7 @@ added: v9.4.0 | |
--> | |
* `eventName` {string|symbol} | |
-* Returns: {Function[]} | |
+* Returns: {Function\[]} | |
Returns a copy of the array of listeners for the event named `eventName`, | |
including any wrappers (such as those created by `.once()`). | |
@@ -763,12 +783,12 @@ added: v0.11.2 | |
By default, a maximum of `10` listeners can be registered for any single | |
event. This limit can be changed for individual `EventEmitter` instances | |
using the [`emitter.setMaxListeners(n)`][] method. To change the default | |
-for *all* `EventEmitter` instances, the `events.defaultMaxListeners` | |
+for _all_ `EventEmitter` instances, the `events.defaultMaxListeners` | |
property can be used. If this value is not a positive number, a `RangeError` | |
is thrown. | |
Take caution when setting the `events.defaultMaxListeners` because the | |
-change affects *all* `EventEmitter` instances, including those created before | |
+change affects _all_ `EventEmitter` instances, including those created before | |
the change is made. However, calling [`emitter.setMaxListeners(n)`][] still has | |
precedence over `events.defaultMaxListeners`. | |
@@ -816,9 +838,10 @@ added: | |
- v15.2.0 | |
- v14.17.0 | |
--> | |
+ | |
* `emitterOrTarget` {EventEmitter|EventTarget} | |
* `eventName` {string|symbol} | |
-* Returns: {Function[]} | |
+* Returns: {Function\[]} | |
Returns a copy of the array of listeners for the event named `eventName`. | |
@@ -976,7 +1000,7 @@ process.nextTick(() => { | |
foo().then(() => console.log('done')); | |
``` | |
-To catch both events, create each of the Promises *before* awaiting either | |
+To catch both events, create each of the Promises _before_ awaiting either | |
of them, then it becomes possible to use `Promise.all()`, `Promise.race()`, | |
or `Promise.allSettled()`: | |
@@ -1121,7 +1150,7 @@ added: v15.4.0 | |
* `n` {number} A non-negative number. The maximum number of listeners per | |
`EventTarget` event. | |
-* `...eventsTargets` {EventTarget[]|EventEmitter[]} Zero or more {EventTarget} | |
+* `...eventsTargets` {EventTarget\[]|EventEmitter\[]} Zero or more {EventTarget} | |
or {EventEmitter} instances. If none are specified, `n` is set as the default | |
max for all newly created {EventTarget} and {EventEmitter} objects. | |
@@ -1170,7 +1201,7 @@ target.addEventListener('foo', (event) => { | |
There are two key differences between the Node.js `EventTarget` and the | |
[`EventTarget` Web API][]: | |
-1. Whereas DOM `EventTarget` instances *may* be hierarchical, there is no | |
+1. Whereas DOM `EventTarget` instances _may_ be hierarchical, there is no | |
concept of hierarchy and event propagation in Node.js. That is, an event | |
dispatched to an `EventTarget` does not propagate through a hierarchy of | |
nested target objects that may each have their own set of handlers for the | |
@@ -1183,8 +1214,8 @@ There are two key differences between the Node.js `EventTarget` and the | |
### `NodeEventTarget` vs. `EventEmitter` | |
The `NodeEventTarget` object implements a modified subset of the | |
-`EventEmitter` API that allows it to closely *emulate* an `EventEmitter` in | |
-certain situations. A `NodeEventTarget` is *not* an instance of `EventEmitter` | |
+`EventEmitter` API that allows it to closely _emulate_ an `EventEmitter` in | |
+certain situations. A `NodeEventTarget` is _not_ an instance of `EventEmitter` | |
and cannot be used in place of an `EventEmitter` in most cases. | |
1. Unlike `EventEmitter`, any given `listener` can be registered at most once | |
@@ -1197,7 +1228,7 @@ and cannot be used in place of an `EventEmitter` in most cases. | |
`'removeListener'` events will also not be emitted. | |
3. The `NodeEventTarget` does not implement any special default behavior | |
for events with type `'error'`. | |
-3. The `NodeEventTarget` supports `EventListener` objects as well as | |
+4. The `NodeEventTarget` supports `EventListener` objects as well as | |
functions as handlers for all event types. | |
### Event listener | |
@@ -1259,7 +1290,7 @@ by default the error is treated as an uncaught exception on | |
`process.nextTick()`. This means uncaught exceptions in `EventTarget`s will | |
terminate the Node.js process by default. | |
-Throwing within an event listener will *not* stop the other registered handlers | |
+Throwing within an event listener will _not_ stop the other registered handlers | |
from being invoked. | |
The `EventTarget` does not implement any special default handling for `'error'` | |
@@ -1538,7 +1596,7 @@ equivalent `EventEmitter` API. The only difference between `addListener()` and | |
added: v14.5.0 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Node.js-specific extension to the `EventTarget` class that returns an array | |
of event `type` names for which event listeners are registered. | |
diff --git a/doc/api/fs.md b/doc/api/fs.md | |
index 42aaf1e3c7..a3df3b71ef 100644 | |
--- a/doc/api/fs.md | |
+++ b/doc/api/fs.md | |
@@ -250,7 +258,7 @@ returned by this method has a default `highWaterMark` of 64 kb. | |
`options` can include `start` and `end` values to read a range of bytes from | |
the file instead of the entire file. Both `start` and `end` are inclusive and | |
start counting at 0, allowed values are in the | |
-[0, [`Number.MAX_SAFE_INTEGER`][]] range. If `start` is | |
+\[0, [`Number.MAX_SAFE_INTEGER`][]] range. If `start` is | |
omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from | |
the current file position. The `encoding` can be any one of those accepted by | |
{Buffer}. | |
@@ -310,9 +319,9 @@ added: v16.11.0 | |
`options` may also include a `start` option to allow writing data at some | |
position past the beginning of the file, allowed values are in the | |
-[0, [`Number.MAX_SAFE_INTEGER`][]] range. Modifying a file rather than replacing | |
-it may require the `flags` `open` option to be set to `r+` rather than the | |
-default `r`. The `encoding` can be any one of those accepted by {Buffer}. | |
+\[0, [`Number.MAX_SAFE_INTEGER`][]] range. Modifying a file rather than | |
+replacing it may require the `flags` `open` option to be set to `r+` rather than | |
+the default `r`. The `encoding` can be any one of those accepted by {Buffer}. | |
If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` | |
the file descriptor will be closed automatically. If `autoClose` is false, | |
@@ -469,13 +486,13 @@ added: | |
- v12.17.0 | |
--> | |
-* `buffers` {Buffer[]|TypedArray[]|DataView[]} | |
+* `buffers` {Buffer\[]|TypedArray\[]|DataView\[]} | |
* `position` {integer} The offset from the beginning of the file where the data | |
should be read from. If `position` is not a `number`, the data will be read | |
from the current position. | |
* Returns: {Promise} Fulfills upon success an object containing two properties: | |
* `bytesRead` {integer} the number of bytes read | |
- * `buffers` {Buffer[]|TypedArray[]|DataView[]} property containing | |
+ * `buffers` {Buffer\[]|TypedArray\[]|DataView\[]} property containing | |
a reference to the `buffers` input. | |
Read from a file and write to an array of {ArrayBufferView}s | |
@@ -680,7 +705,7 @@ beginning of the file. | |
added: v12.9.0 | |
--> | |
-* `buffers` {Buffer[]|TypedArray[]|DataView[]} | |
+* `buffers` {Buffer\[]|TypedArray\[]|DataView\[]} | |
* `position` {integer} The offset from the beginning of the file where the | |
data from `buffers` should be written. If `position` is not a `number`, | |
the data will be written at the current position. | |
@@ -691,7 +716,7 @@ Write an array of {ArrayBufferView}s to the file. | |
The promise is resolved with an object containing a two properties: | |
* `bytesWritten` {integer} the number of bytes written | |
-* `buffers` {Buffer[]|TypedArray[]|DataView[]} a reference to the `buffers` | |
+* `buffers` {Buffer\[]|TypedArray\[]|DataView\[]} a reference to the `buffers` | |
input. | |
It is unsafe to call `writev()` multiple times on the same file without waiting | |
@@ -856,7 +887,7 @@ added: v16.7.0 | |
* `filter` {Function} Function to filter copied files/directories. Return | |
`true` to copy the item, `false` to ignore it. Can also return a `Promise` | |
that resolves to `true` or `false` **Default:** `undefined`. | |
- * `force` {boolean} overwrite existing file or directory. _The copy | |
+ * `force` {boolean} overwrite existing file or directory. \_The copy | |
operation will ignore errors if you set this to false and the destination | |
exists. Use the `errorOnExist` option to change this behavior. | |
**Default:** `true`. | |
@@ -1008,7 +1046,7 @@ try { | |
The `fsPromises.mkdtemp()` method will append the six randomly selected | |
characters directly to the `prefix` string. For instance, given a directory | |
-`/tmp`, if the intention is to create a temporary directory *within* `/tmp`, the | |
+`/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the | |
`prefix` must end with a trailing platform-specific path separator | |
(`require('path').sep`). | |
@@ -1407,7 +1461,7 @@ added: | |
specified, and only on supported platforms (See [caveats][]). **Default:** | |
`false`. | |
* `encoding` {string} Specifies the character encoding to be used for the | |
- filename passed to the listener. **Default:** `'utf8'`. | |
+ filename passed to the listener. **Default:** `'utf8'`. | |
* `signal` {AbortSignal} An {AbortSignal} used to signal when the watcher | |
should stop. | |
* Returns: {AsyncIterator} of objects with the properties: | |
@@ -1845,7 +1903,7 @@ The `mode` argument used in both the `fs.chmod()` and `fs.chmodSync()` | |
methods is a numeric bitmask created using a logical OR of the following | |
constants: | |
-| Constant | Octal | Description | | |
+| Constant | Octal | Description | | |
| ---------------------- | ------- | ------------------------ | | |
| `fs.constants.S_IRUSR` | `0o400` | read by owner | | |
| `fs.constants.S_IWUSR` | `0o200` | write by owner | | |
@@ -2015,7 +2077,7 @@ added: v16.7.0 | |
* `filter` {Function} Function to filter copied files/directories. Return | |
`true` to copy the item, `false` to ignore it. Can also return a `Promise` | |
that resolves to `true` or `false` **Default:** `undefined`. | |
- * `force` {boolean} overwrite existing file or directory. _The copy | |
+ * `force` {boolean} overwrite existing file or directory. \_The copy | |
operation will ignore errors if you set this to false and the destination | |
exists. Use the `errorOnExist` option to change this behavior. | |
**Default:** `true`. | |
@@ -2094,7 +2157,7 @@ returned by this method has a default `highWaterMark` of 64 kb. | |
`options` can include `start` and `end` values to read a range of bytes from | |
the file instead of the entire file. Both `start` and `end` are inclusive and | |
start counting at 0, allowed values are in the | |
-[0, [`Number.MAX_SAFE_INTEGER`][]] range. If `fd` is specified and `start` is | |
+\[0, [`Number.MAX_SAFE_INTEGER`][]] range. If `fd` is specified and `start` is | |
omitted or `undefined`, `fs.createReadStream()` reads sequentially from the | |
current file position. The `encoding` can be any one of those accepted by | |
{Buffer}. | |
@@ -2210,9 +2274,9 @@ changes: | |
`options` may also include a `start` option to allow writing data at some | |
position past the beginning of the file, allowed values are in the | |
-[0, [`Number.MAX_SAFE_INTEGER`][]] range. Modifying a file rather than replacing | |
-it may require the `flags` option to be set to `r+` rather than the default `w`. | |
-The `encoding` can be any one of those accepted by {Buffer}. | |
+\[0, [`Number.MAX_SAFE_INTEGER`][]] range. Modifying a file rather than | |
+replacing it may require the `flags` option to be set to `r+` rather than the | |
+default `w`. The `encoding` can be any one of those accepted by {Buffer}. | |
If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` | |
the file descriptor will be closed automatically. If `autoClose` is false, | |
@@ -2864,7 +2943,7 @@ mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { | |
The `fs.mkdtemp()` method will append the six randomly selected characters | |
directly to the `prefix` string. For instance, given a directory `/tmp`, if the | |
-intention is to create a temporary directory *within* `/tmp`, the `prefix` | |
+intention is to create a temporary directory _within_ `/tmp`, the `prefix` | |
must end with a trailing platform-specific path separator | |
(`require('path').sep`). | |
@@ -3063,7 +3148,7 @@ changes: | |
* `withFileTypes` {boolean} **Default:** `false` | |
* `callback` {Function} | |
* `err` {Error} | |
- * `files` {string[]|Buffer[]|fs.Dirent[]} | |
+ * `files` {string\[]|Buffer\[]|fs.Dirent\[]} | |
Reads the contents of a directory. The callback gets two arguments `(err, files)` | |
where `files` is an array of the names of the files in the directory excluding | |
@@ -3262,12 +3350,12 @@ added: | |
--> | |
* `fd` {integer} | |
-* `buffers` {ArrayBufferView[]} | |
+* `buffers` {ArrayBufferView\[]} | |
* `position` {integer} | |
* `callback` {Function} | |
* `err` {Error} | |
* `bytesRead` {integer} | |
- * `buffers` {ArrayBufferView[]} | |
+ * `buffers` {ArrayBufferView\[]} | |
Read from a file specified by `fd` and write to an array of `ArrayBufferView`s | |
using `readv()`. | |
@@ -3773,7 +3871,7 @@ added: v0.1.31 | |
`fs.watchFile()` | |
Stop watching for changes on `filename`. If `listener` is specified, only that | |
-particular listener is removed. Otherwise, *all* listeners are removed, | |
+particular listener is removed. Otherwise, _all_ listeners are removed, | |
effectively stopping watching of `filename`. | |
Calling `fs.unwatchFile()` with a filename that is not being watched is a | |
@@ -3851,7 +3951,7 @@ changes: | |
specified, and only on supported platforms (See [caveats][]). **Default:** | |
`false`. | |
* `encoding` {string} Specifies the character encoding to be used for the | |
- filename passed to the listener. **Default:** `'utf8'`. | |
+ filename passed to the listener. **Default:** `'utf8'`. | |
* `signal` {AbortSignal} allows closing the watcher with an AbortSignal. | |
* `listener` {Function|undefined} **Default:** `undefined` | |
* `eventType` {string} | |
@@ -3924,7 +4024,7 @@ this method is slower and less reliable. | |
On Linux and macOS systems, `fs.watch()` resolves the path to an [inode][] and | |
watches the inode. If the watched path is deleted and recreated, it is assigned | |
a new inode. The watch will emit an event for the delete but will continue | |
-watching the *original* inode. Events for the new inode will not be emitted. | |
+watching the _original_ inode. Events for the new inode will not be emitted. | |
This is expected behavior. | |
AIX files retain the same inode for the lifetime of a file. Saving and closing a | |
@@ -4301,12 +4406,12 @@ added: v12.9.0 | |
--> | |
* `fd` {integer} | |
-* `buffers` {ArrayBufferView[]} | |
+* `buffers` {ArrayBufferView\[]} | |
* `position` {integer} | |
* `callback` {Function} | |
* `err` {Error} | |
* `bytesWritten` {integer} | |
- * `buffers` {ArrayBufferView[]} | |
+ * `buffers` {ArrayBufferView\[]} | |
Write an array of `ArrayBufferView`s to the file specified by `fd` using | |
`writev()`. | |
@@ -4541,7 +4653,7 @@ added: v16.7.0 | |
exists, throw an error. **Default:** `false`. | |
* `filter` {Function} Function to filter copied files/directories. Return | |
`true` to copy the item, `false` to ignore it. **Default:** `undefined` | |
- * `force` {boolean} overwrite existing file or directory. _The copy | |
+ * `force` {boolean} overwrite existing file or directory. \_The copy | |
operation will ignore errors if you set this to false and the destination | |
exists. Use the `errorOnExist` option to change this behavior. | |
**Default:** `true`. | |
@@ -4877,7 +5006,7 @@ changes: | |
* `path` {string|Buffer|URL} | |
* `flags` {string|number} **Default:** `'r'`. | |
- See [support of file system `flags`][]. | |
+ See [support of file system `flags`][]. | |
* `mode` {string|integer} **Default:** `0o666` | |
* Returns: {number} | |
@@ -4903,7 +5033,7 @@ changes: | |
* `options` {string|Object} | |
* `encoding` {string} **Default:** `'utf8'` | |
* `withFileTypes` {boolean} **Default:** `false` | |
-* Returns: {string[]|Buffer[]|fs.Dirent[]} | |
+* Returns: {string\[]|Buffer\[]|fs.Dirent\[]} | |
Reads the contents of the directory. | |
@@ -5045,7 +5180,7 @@ added: | |
--> | |
* `fd` {integer} | |
-* `buffers` {ArrayBufferView[]} | |
+* `buffers` {ArrayBufferView\[]} | |
* `position` {integer} | |
* Returns: {number} The number of bytes read. | |
@@ -5432,7 +5581,7 @@ added: v12.9.0 | |
--> | |
* `fd` {integer} | |
-* `buffers` {ArrayBufferView[]} | |
+* `buffers` {ArrayBufferView\[]} | |
* `position` {integer} | |
* Returns: {number} The number of bytes written. | |
@@ -5752,7 +5925,7 @@ added: | |
* Returns: {fs.FSWatcher} | |
-When called, requests that the Node.js event loop *not* exit so long as the | |
+When called, requests that the Node.js event loop _not_ exit so long as the | |
{fs.FSWatcher} is active. Calling `watcher.ref()` multiple times will have | |
no effect. | |
@@ -5796,7 +5972,7 @@ added: | |
* Returns: {fs.StatWatcher} | |
-When called, requests that the Node.js event loop *not* exit so long as the | |
+When called, requests that the Node.js event loop _not_ exit so long as the | |
{fs.StatWatcher} is active. Calling `watcher.ref()` multiple times will have | |
no effect. | |
@@ -6858,7 +7072,7 @@ example `fs.readdirSync('C:\\')` can potentially return a different result than | |
On POSIX systems, for every process, the kernel maintains a table of currently | |
open files and resources. Each open file is assigned a simple numeric | |
-identifier called a *file descriptor*. At the system-level, all file system | |
+identifier called a _file descriptor_. At the system-level, all file system | |
operations use these file descriptors to identify and track each specific | |
file. Windows systems use a different but conceptually similar mechanism for | |
tracking resources. To simplify things for users, Node.js abstracts away the | |
diff --git a/doc/api/http.md b/doc/api/http.md | |
index d059469de2..0eedaa8508 100644 | |
--- a/doc/api/http.md | |
+++ b/doc/api/http.md | |
@@ -146,13 +150,13 @@ changes: | |
for TCP Keep-Alive packets. Ignored when the | |
`keepAlive` option is `false` or `undefined`. **Default:** `1000`. | |
* `maxSockets` {number} Maximum number of sockets to allow per host. | |
- If the same host opens multiple concurrent connections, each request | |
- will use new socket until the `maxSockets` value is reached. | |
- If the host attempts to open more connections than `maxSockets`, | |
- the additional requests will enter into a pending request queue, and | |
- will enter active connection state when an existing connection terminates. | |
- This makes sure there are at most `maxSockets` active connections at | |
- any point in time, from a given host. | |
+ If the same host opens multiple concurrent connections, each request | |
+ will use new socket until the `maxSockets` value is reached. | |
+ If the host attempts to open more connections than `maxSockets`, | |
+ the additional requests will enter into a pending request queue, and | |
+ will enter active connection state when an existing connection terminates. | |
+ This makes sure there are at most `maxSockets` active connections at | |
+ any point in time, from a given host. | |
**Default:** `Infinity`. | |
* `maxTotalSockets` {number} Maximum number of sockets allowed for | |
all hosts in total. Each request will use a new socket | |
@@ -378,7 +394,7 @@ added: v0.1.17 | |
This object is created internally and returned from [`http.request()`][]. It | |
represents an _in-progress_ request whose header has already been queued. The | |
header is still mutable using the [`setHeader(name, value)`][], | |
- [`getHeader(name)`][], [`removeHeader(name)`][] API. The actual header will | |
+[`getHeader(name)`][], [`removeHeader(name)`][] API. The actual header will | |
be sent along with the first data chunk or when calling [`request.end()`][]. | |
To get the response, add a listener for [`'response'`][] to the request object. | |
@@ -510,7 +530,7 @@ added: v10.0.0 | |
* `statusCode` {integer} | |
* `statusMessage` {string} | |
* `headers` {Object} | |
- * `rawHeaders` {string[]} | |
+ * `rawHeaders` {string\[]} | |
Emitted when the server sends a 1xx intermediate response (excluding 101 | |
Upgrade). The listeners of this event will receive an object containing the | |
@@ -792,7 +826,7 @@ added: | |
- v14.17.0 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns an array containing the unique names of the current outgoing raw | |
headers. Header names are returned with their exact casing being set. | |
@@ -1151,7 +1203,7 @@ server.listen(8000); | |
When the `'clientError'` event occurs, there is no `request` or `response` | |
object, so any HTTP response sent, including response headers and payload, | |
-*must* be written directly to the `socket` object. Care must be taken to | |
+_must_ be written directly to the `socket` object. Care must be taken to | |
ensure the response is a properly formatted HTTP response message. | |
`err` is an instance of `Error` with two extra columns: | |
@@ -1566,7 +1643,7 @@ const setCookie = response.getHeader('set-cookie'); | |
added: v7.7.0 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns an array containing the unique names of the current outgoing headers. | |
All header names are lowercase. | |
@@ -1595,7 +1673,7 @@ are lowercase. | |
The object returned by the `response.getHeaders()` method _does not_ | |
prototypically inherit from the JavaScript `Object`. This means that typical | |
`Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others | |
-are not defined and *will not work*. | |
+are not defined and _will not work_. | |
```js | |
response.setHeader('Foo', 'bar'); | |
@@ -1905,7 +1999,7 @@ Optionally one can give a human-readable `statusMessage` as the second | |
argument. | |
`headers` may be an `Array` where the keys and values are in the same list. | |
-It is *not* a list of tuples. So, the even-numbered offsets are key values, | |
+It is _not_ a list of tuples. So, the even-numbered offsets are key values, | |
and the odd-numbered offsets are the associated values. The array is in the same | |
format as `request.rawHeaders`. | |
@@ -2145,11 +2251,11 @@ The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. | |
added: v0.11.6 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The raw request/response headers list exactly as they were received. | |
-The keys and values are in the same list. It is *not* a | |
+The keys and values are in the same list. It is _not_ a | |
list of tuples. So, the even-numbered offsets are key values, and the | |
odd-numbered offsets are the associated values. | |
@@ -2174,7 +2281,7 @@ console.log(request.rawHeaders); | |
added: v0.11.6 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The raw request/response trailer keys and values exactly as they were | |
received. Only populated at the `'end'` event. | |
@@ -2428,7 +2554,7 @@ exist in message, it will be `undefined`. | |
added: v8.0.0 | |
--> | |
-* Returns {string[]} | |
+* Returns {string\[]} | |
Returns an array of names of headers of the outgoing outgoingMessage. All | |
names are lowercase. | |
@@ -2662,7 +2805,7 @@ memory. Event `drain` will be emitted when the buffer is free again. | |
added: v0.11.8 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
A list of the HTTP methods that are supported by the parser. | |
@@ -2940,7 +3092,7 @@ changes: | |
* `setHost` {boolean}: Specifies whether or not to automatically add the | |
`Host` header. Defaults to `true`. | |
* `socketPath` {string} Unix Domain Socket (cannot be used if one of `host` | |
- or `port` is specified, those specify a TCP Socket). | |
+ or `port` is specified, those specify a TCP Socket). | |
* `timeout` {number}: A number specifying the socket timeout in milliseconds. | |
This will set the timeout before the socket is connected. | |
* `signal` {AbortSignal}: An AbortSignal that may be used to abort an ongoing | |
diff --git a/doc/api/http2.md b/doc/api/http2.md | |
index f620e1b40c..6932742ca7 100644 | |
--- a/doc/api/http2.md | |
+++ b/doc/api/http2.md | |
@@ -31,7 +33,7 @@ const http2 = require('http2'); | |
## Core API | |
The Core API provides a low-level interface designed specifically around | |
-support for HTTP/2 protocol features. It is specifically *not* designed for | |
+support for HTTP/2 protocol features. It is specifically _not_ designed for | |
compatibility with the existing [HTTP/1][] module API. However, | |
the [Compatibility API][] is. | |
@@ -114,7 +117,7 @@ added: v8.4.0 | |
* Extends: {EventEmitter} | |
Instances of the `http2.Http2Session` class represent an active communications | |
-session between an HTTP/2 client and server. Instances of this class are *not* | |
+session between an HTTP/2 client and server. Instances of this class are _not_ | |
intended to be constructed directly by user code. | |
Each `Http2Session` instance will exhibit slightly different behaviors | |
@@ -350,7 +365,7 @@ added: v9.4.0 | |
Gracefully closes the `Http2Session`, allowing any existing streams to | |
complete on their own and preventing new `Http2Stream` instances from being | |
-created. Once closed, `http2session.destroy()` *might* be called if there | |
+created. Once closed, `http2session.destroy()` _might_ be called if there | |
are no open `Http2Stream` instances. | |
If specified, the `callback` function is registered as a handler for the | |
@@ -430,7 +451,7 @@ added: v9.4.0 | |
* `opaqueData` {Buffer|TypedArray|DataView} A `TypedArray` or `DataView` | |
instance containing additional data to be carried within the `GOAWAY` frame. | |
-Transmits a `GOAWAY` frame to the connected peer *without* shutting down the | |
+Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the | |
`Http2Session`. | |
#### `http2session.localSettings` | |
@@ -441,14 +463,15 @@ added: v8.4.0 | |
* {HTTP/2 Settings Object} | |
A prototype-less object describing the current local settings of this | |
-`Http2Session`. The local settings are local to *this* `Http2Session` instance. | |
+`Http2Session`. The local settings are local to _this_ `Http2Session` instance. | |
#### `http2session.originSet` | |
+ | |
<!-- YAML | |
added: v9.4.0 | |
--> | |
-* {string[]|undefined} | |
+* {string\[]|undefined} | |
If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property | |
will return an `Array` of origins for which the `Http2Session` may be | |
@@ -522,9 +549,10 @@ added: v8.4.0 | |
* {HTTP/2 Settings Object} | |
A prototype-less object describing the current remote settings of this | |
-`Http2Session`. The remote settings are set by the *connected* HTTP/2 peer. | |
+`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. | |
#### `http2session.setLocalWindowSize(windowSize)` | |
+ | |
<!-- YAML | |
added: | |
- v15.3.0 | |
@@ -691,7 +727,7 @@ server.on('stream', (stream) => { | |
Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate | |
service is associated with the origin of the given `Http2Stream`. | |
-The `alt` and origin string *must* contain only ASCII bytes and are | |
+The `alt` and origin string _must_ contain only ASCII bytes and are | |
strictly interpreted as a sequence of ASCII bytes. The special value `'clear'` | |
may be passed to clear any previously set alternative service for a given | |
domain. | |
@@ -704,7 +740,7 @@ cannot be parsed as a URL or if a valid origin cannot be derived. | |
A `URL` object, or any object with an `origin` property, may be passed as | |
`originOrStream`, in which case the value of the `origin` property will be | |
-used. The value of the `origin` property *must* be a properly serialized | |
+used. The value of the `origin` property _must_ be a properly serialized | |
ASCII origin. | |
#### Specifying alternative services | |
@@ -715,7 +751,7 @@ associated with a specific host and port. | |
For example, the value `'h2="example.org:81"'` indicates that the HTTP/2 | |
protocol is available on the host `'example.org'` on TCP/IP port 81. The | |
-host and port *must* be contained within the quote (`"`) characters. | |
+host and port _must_ be contained within the quote (`"`) characters. | |
Multiple alternatives may be specified, for instance: `'h2="example.org:81", | |
h2=":82"'`. | |
@@ -759,7 +796,7 @@ cannot be parsed as a URL or if a valid origin cannot be derived. | |
A `URL` object, or any object with an `origin` property, may be passed as | |
an `origin`, in which case the value of the `origin` property will be | |
-used. The value of the `origin` property *must* be a properly serialized | |
+used. The value of the `origin` property _must_ be a properly serialized | |
ASCII origin. | |
Alternatively, the `origins` option may be used when creating a new HTTP/2 | |
@@ -813,7 +853,7 @@ client.on('altsvc', (alt, origin, streamId) => { | |
added: v10.12.0 | |
--> | |
-* `origins` {string[]} | |
+* `origins` {string\[]} | |
The `'origin'` event is emitted whenever an `ORIGIN` frame is received by | |
the client. The event is emitted with an array of `origin` strings. The | |
@@ -838,8 +879,9 @@ added: v8.4.0 | |
--> | |
* `headers` {HTTP/2 Headers Object} | |
+ | |
* `options` {Object} | |
- * `endStream` {boolean} `true` if the `Http2Stream` *writable* side should | |
+ * `endStream` {boolean} `true` if the `Http2Stream` _writable_ side should | |
be closed initially, such as when sending a `GET` request that should not | |
expect a payload body. | |
* `exclusive` {boolean} When `true` and `parent` identifies a parent Stream, | |
@@ -1218,7 +1281,7 @@ An object containing the outbound headers sent for this `Http2Stream`. | |
added: v9.5.0 | |
--> | |
-* {HTTP/2 Headers Object[]} | |
+* {HTTP/2 Headers Object\[]} | |
An array of objects containing the outbound informational (additional) headers | |
sent for this `Http2Stream`. | |
@@ -1594,7 +1675,7 @@ sent. The `http2stream.sendTrailers()` method can then be used to sent trailing | |
header fields to the peer. | |
When `options.waitForTrailers` is set, the `Http2Stream` will not automatically | |
-close when the final `DATA` frame is transmitted. User code *must* call either | |
+close when the final `DATA` frame is transmitted. User code _must_ call either | |
`http2stream.sendTrailers()` or `http2stream.close()` to close the | |
`Http2Stream`. | |
@@ -2407,7 +2516,7 @@ changes: | |
remote peer upon connection. | |
* ...: Any [`tls.createServer()`][] options can be provided. For | |
servers, the identity options (`pfx` or `key`/`cert`) are usually required. | |
- * `origins` {string[]} An array of origin strings to send within an `ORIGIN` | |
+ * `origins` {string\[]} An array of origin strings to send within an `ORIGIN` | |
frame immediately following creation of a new server `Http2Session`. | |
* `unknownProtocolTimeout` {number} Specifies a timeout in milliseconds that | |
a server should wait when an [`'unknownProtocol'`][] event is emitted. If | |
@@ -2563,7 +2674,7 @@ added: v8.4.0 | |
#### Error codes for `RST_STREAM` and `GOAWAY` | |
| Value | Name | Constant | | |
-|--------|---------------------|-----------------------------------------------| | |
+| ------ | ------------------- | --------------------------------------------- | | |
| `0x00` | No Error | `http2.constants.NGHTTP2_NO_ERROR` | | |
| `0x01` | Protocol Error | `http2.constants.NGHTTP2_PROTOCOL_ERROR` | | |
| `0x02` | Internal Error | `http2.constants.NGHTTP2_INTERNAL_ERROR` | | |
@@ -2736,7 +2853,7 @@ properties. | |
is 2<sup>32</sup>-1. **Default:** `4096`. | |
* `enablePush` {boolean} Specifies `true` if HTTP/2 Push Streams are to be | |
permitted on the `Http2Session` instances. **Default:** `true`. | |
-* `initialWindowSize` {number} Specifies the *sender's* initial window size in | |
+* `initialWindowSize` {number} Specifies the _sender's_ initial window size in | |
bytes for stream-level flow control. The minimum allowed value is 0. The | |
maximum allowed value is 2<sup>32</sup>-1. **Default:** `65535`. | |
* `maxFrameSize` {number} Specifies the size in bytes of the largest frame | |
@@ -2787,20 +2904,20 @@ on where and when the error occurs. | |
The HTTP/2 implementation applies stricter handling of invalid characters in | |
HTTP header names and values than the HTTP/1 implementation. | |
-Header field names are *case-insensitive* and are transmitted over the wire | |
+Header field names are _case-insensitive_ and are transmitted over the wire | |
strictly as lower-case strings. The API provided by Node.js allows header | |
names to be set as mixed-case strings (e.g. `Content-Type`) but will convert | |
those to lower-case (e.g. `content-type`) upon transmission. | |
-Header field-names *must only* contain one or more of the following ASCII | |
+Header field-names _must only_ contain one or more of the following ASCII | |
characters: `a`-`z`, `A`-`Z`, `0`-`9`, `!`, `#`, `$`, `%`, `&`, `'`, `*`, `+`, | |
`-`, `.`, `^`, `_`, `` ` `` (backtick), `|`, and `~`. | |
Using invalid characters within an HTTP header field name will cause the | |
stream to be closed with a protocol error being reported. | |
-Header field values are handled with more leniency but *should* not contain | |
-new-line or carriage return characters and *should* be limited to US-ASCII | |
+Header field values are handled with more leniency but _should_ not contain | |
+new-line or carriage return characters and _should_ be limited to US-ASCII | |
characters, per the requirements of the HTTP specification. | |
### Push streams on the client | |
@@ -3147,11 +3276,11 @@ The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. | |
added: v8.4.0 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The raw request/response headers list exactly as they were received. | |
-The keys and values are in the same list. It is *not* a | |
+The keys and values are in the same list. It is _not_ a | |
list of tuples. So, the even-numbered offsets are key values, and the | |
odd-numbered offsets are the associated values. | |
@@ -3176,7 +3306,7 @@ console.log(request.rawHeaders); | |
added: v8.4.0 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The raw request/response trailer keys and values exactly as they were | |
received. Only populated at the `'end'` event. | |
@@ -3429,7 +3576,7 @@ const contentType = response.getHeader('content-type'); | |
added: v8.4.0 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns an array containing the unique names of the current outgoing headers. | |
All header names are lowercase. | |
@@ -3458,7 +3606,7 @@ are lowercase. | |
The object returned by the `response.getHeaders()` method _does not_ | |
prototypically inherit from the JavaScript `Object`. This means that typical | |
`Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others | |
-are not defined and *will not work*. | |
+are not defined and _will not work_. | |
```js | |
response.setHeader('Foo', 'bar'); | |
@@ -3533,7 +3687,7 @@ added: v8.4.0 | |
--> | |
* `name` {string} | |
-* `value` {string|string[]} | |
+* `value` {string|string\[]} | |
Sets a single header value for implicit headers. If this header already exists | |
in the to-be-sent headers, its value will be replaced. Use an array of strings | |
diff --git a/doc/api/index.md b/doc/api/index.md | |
index 8ea274ec47..0e7bf073d2 100644 | |
--- a/doc/api/index.md | |
+++ b/doc/api/index.md | |
@@ -11,13 +11,13 @@ | |
<hr class="line"/> | |
* [Assertion testing](assert.md) | |
-* [Async_context](async_context.md) | |
-* [Async hooks](async_hooks.md) | |
+* [Async\_context](async\_context.md) | |
+* [Async hooks](async\_hooks.md) | |
* [Buffer](buffer.md) | |
* [C++ addons](addons.md) | |
* [C/C++ addons with Node-API](n-api.md) | |
* [C++ embedder API](embedding.md) | |
-* [Child processes](child_process.md) | |
+* [Child processes](child\_process.md) | |
* [Cluster](cluster.md) | |
* [Command-line options](cli.md) | |
* [Console](console.md) | |
@@ -25,7 +25,7 @@ | |
* [Crypto](crypto.md) | |
* [Debugger](debugger.md) | |
* [Deprecated APIs](deprecations.md) | |
-* [Diagnostics Channel](diagnostics_channel.md) | |
+* [Diagnostics Channel](diagnostics\_channel.md) | |
* [DNS](dns.md) | |
* [Domain](domain.md) | |
* [Errors](errors.md) | |
@@ -44,7 +44,7 @@ | |
* [Net](net.md) | |
* [OS](os.md) | |
* [Path](path.md) | |
-* [Performance hooks](perf_hooks.md) | |
+* [Performance hooks](perf\_hooks.md) | |
* [Policies](policy.md) | |
* [Process](process.md) | |
* [Punycode](punycode.md) | |
@@ -53,7 +53,7 @@ | |
* [REPL](repl.md) | |
* [Report](report.md) | |
* [Stream](stream.md) | |
-* [String decoder](string_decoder.md) | |
+* [String decoder](string\_decoder.md) | |
* [Timers](timers.md) | |
* [TLS/SSL](tls.md) | |
* [Trace events](tracing.md) | |
@@ -66,7 +66,7 @@ | |
* [WASI](wasi.md) | |
* [Web Crypto API](webcrypto.md) | |
* [Web Streams API](webstreams.md) | |
-* [Worker threads](worker_threads.md) | |
+* [Worker threads](worker\_threads.md) | |
* [Zlib](zlib.md) | |
<hr class="line"/> | |
diff --git a/doc/api/inspector.md b/doc/api/inspector.md | |
index 04b0283d8c..3d0dbf7799 100644 | |
--- a/doc/api/inspector.md | |
+++ b/doc/api/inspector.md | |
@@ -38,8 +38,8 @@ console. | |
* `wait` {boolean} Block until a client has connected. Optional. | |
**Default:** `false`. | |
-Activate inspector on host and port. Equivalent to `node | |
---inspect=[[host:]port]`, but can be done programmatically after node has | |
+Activate inspector on host and port. Equivalent to | |
+`node --inspect=[[host:]port]`, but can be done programmatically after node has | |
started. | |
If wait is `true`, will block until a client has connected to the inspect port | |
diff --git a/doc/api/intl.md b/doc/api/intl.md | |
index 716047a7c3..cf4a852035 100644 | |
--- a/doc/api/intl.md | |
+++ b/doc/api/intl.md | |
@@ -45,7 +45,7 @@ An overview of available Node.js and JavaScript features for each `configure` | |
option: | |
| Feature | `none` | `system-icu` | `small-icu` | `full-icu` | | |
-|-----------------------------------------|-----------------------------------|------------------------------|------------------------|------------| | |
+| --------------------------------------- | --------------------------------- | ---------------------------- | ---------------------- | ---------- | | |
| [`String.prototype.normalize()`][] | none (function is no-op) | full | full | full | | |
| `String.prototype.to*Case()` | full | full | full | full | | |
| [`Intl`][] | none (object does not exist) | partial/full (depends on OS) | partial (English-only) | full | | |
@@ -80,7 +80,7 @@ OS. | |
Functionalities that only require the ICU library itself, such as | |
[`String.prototype.normalize()`][] and the [WHATWG URL parser][], are fully | |
supported under `system-icu`. Features that require ICU locale data in | |
-addition, such as [`Intl.DateTimeFormat`][] *may* be fully or partially | |
+addition, such as [`Intl.DateTimeFormat`][] _may_ be fully or partially | |
supported, depending on the completeness of the ICU data installed on the | |
system. | |
diff --git a/doc/api/module.md b/doc/api/module.md | |
index 519240841a..749bd350ba 100644 | |
--- a/doc/api/module.md | |
+++ b/doc/api/module.md | |
@@ -22,7 +23,7 @@ added: | |
- v6.13.0 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
A list of the names of all modules provided by Node.js. Can be used to verify | |
if a module is maintained by a third party or not. | |
@@ -160,9 +167,9 @@ Creates a new `sourceMap` instance. | |
* `file`: {string} | |
* `version`: {number} | |
-* `sources`: {string[]} | |
-* `sourcesContent`: {string[]} | |
-* `names`: {string[]} | |
+* `sources`: {string\[]} | |
+* `sourcesContent`: {string\[]} | |
+* `names`: {string\[]} | |
* `mappings`: {string} | |
* `sourceRoot`: {string} | |
diff --git a/doc/api/modules.md b/doc/api/modules.md | |
index 900c2c158b..44e7959254 100644 | |
--- a/doc/api/modules.md | |
+++ b/doc/api/modules.md | |
@@ -99,7 +99,7 @@ package may itself have dependencies, and in some cases, these may even collide | |
or form cyclic dependencies. | |
Because Node.js looks up the `realpath` of any modules it loads (that is, it | |
-resolves symlinks) and then [looks for their dependencies in `node_modules` folders](#loading-from-node_modules-folders), | |
+resolves symlinks) and then [looks for their dependencies in `node_modules` folders](#loading-from-node\_modules-folders), | |
this situation can be resolved with the following architecture: | |
* `/usr/lib/node/foo/1.2.3/`: Contents of the `foo` package, version 1.2.3. | |
@@ -268,7 +268,7 @@ function. | |
Modules are cached based on their resolved filename. Since modules may resolve | |
to a different filename based on the location of the calling module (loading | |
-from `node_modules` folders), it is not a *guarantee* that `require('foo')` will | |
+from `node_modules` folders), it is not a _guarantee_ that `require('foo')` will | |
always return the exact same object, if it would resolve to different files. | |
Additionally, on case-insensitive file systems or operating systems, different | |
@@ -487,7 +487,7 @@ when people are unaware that `NODE_PATH` must be set. Sometimes a | |
module's dependencies change, causing a different version (or even a | |
different module) to be loaded as the `NODE_PATH` is searched. | |
-Additionally, Node.js will search in the following list of GLOBAL_FOLDERS: | |
+Additionally, Node.js will search in the following list of GLOBAL\_FOLDERS: | |
* 1: `$HOME/.node_modules` | |
* 2: `$HOME/.node_libraries` | |
@@ -745,10 +756,10 @@ changes: | |
* `request` {string} The module path to resolve. | |
* `options` {Object} | |
- * `paths` {string[]} Paths to resolve module location from. If present, these | |
+ * `paths` {string\[]} Paths to resolve module location from. If present, these | |
paths are used instead of the default resolution paths, with the exception | |
- of [GLOBAL_FOLDERS][] like `$HOME/.node_modules`, which are always | |
- included. Each of these paths is used as a starting point for | |
+ of [GLOBAL\_FOLDERS][GLOBAL_FOLDERS] like `$HOME/.node_modules`, which are | |
+ always included. Each of these paths is used as a starting point for | |
the module resolution algorithm, meaning that the `node_modules` hierarchy | |
is checked from this location. | |
* Returns: {string} | |
@@ -764,7 +776,7 @@ added: v8.9.0 | |
--> | |
* `request` {string} The module path whose lookup paths are being retrieved. | |
-* Returns: {string[]|null} | |
+* Returns: {string\[]|null} | |
Returns an array containing the paths searched during resolution of `request` or | |
`null` if the `request` string references a core module, for example `http` or | |
@@ -791,7 +805,7 @@ a global but rather local to each module. | |
added: v0.1.16 | |
--> | |
-* {module[]} | |
+* {module\[]} | |
The module objects required for the first time by this one. | |
@@ -967,7 +991,7 @@ The directory name of the module. This is usually the same as the | |
added: v0.4.0 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The search paths for the module. | |
@@ -984,7 +1009,7 @@ The `module.require()` method provides a way to load a module as if | |
In order to do this, it is necessary to get a reference to the `module` object. | |
Since `require()` returns the `module.exports`, and the `module` is typically | |
-*only* available within a specific module's code, it must be explicitly exported | |
+_only_ available within a specific module's code, it must be explicitly exported | |
in order to be used. | |
## The `Module` object | |
diff --git a/doc/api/n-api.md b/doc/api/n-api.md | |
index 2113ca7ca8..333f5e6483 100644 | |
--- a/doc/api/n-api.md | |
+++ b/doc/api/n-api.md | |
@@ -91,24 +91,24 @@ versions: | |
* the Node.js C++ APIs available via any of | |
- ```cpp | |
- #include <node.h> | |
- #include <node_buffer.h> | |
- #include <node_version.h> | |
- #include <node_object_wrap.h> | |
- ``` | |
+ ```cpp | |
+ #include <node.h> | |
+ #include <node_buffer.h> | |
+ #include <node_version.h> | |
+ #include <node_object_wrap.h> | |
+ ``` | |
* the libuv APIs which are also included with Node.js and available via | |
- ```cpp | |
- #include <uv.h> | |
- ``` | |
+ ```cpp | |
+ #include <uv.h> | |
+ ``` | |
* the V8 API available via | |
- ```cpp | |
- #include <v8.h> | |
- ``` | |
+ ```cpp | |
+ #include <v8.h> | |
+ ``` | |
Thus, for an addon to remain ABI-compatible across Node.js major versions, it | |
must use Node-API exclusively by restricting itself to using | |
@@ -126,7 +126,7 @@ Unlike modules written in JavaScript, developing and deploying Node.js | |
native addons using Node-API requires an additional set of tools. Besides the | |
basic tools required to develop for Node.js, the native addon developer | |
requires a toolchain that can compile C and C++ code into a binary. In | |
-addition, depending upon how the native addon is deployed, the *user* of | |
+addition, depending upon how the native addon is deployed, the _user_ of | |
the native addon will also need to have a C/C++ toolchain installed. | |
For Linux developers, the necessary C/C++ toolchain packages are readily | |
@@ -155,7 +155,7 @@ and deploying Node.js native addons. | |
### Build tools | |
-Both the tools listed here require that *users* of the native | |
+Both the tools listed here require that _users_ of the native | |
addon have a C/C++ toolchain installed in order to successfully install | |
the native addon. | |
@@ -482,7 +482,8 @@ the addon. | |
To this end, Node-API provides a way to allocate data such that its life cycle | |
is tied to the life cycle of the Agent. | |
-### napi_set_instance_data | |
+### napi\_set\_instance\_data | |
+ | |
<!-- YAML | |
added: | |
- v12.8.0 | |
@@ -513,7 +514,8 @@ the currently running Agent which was set by means of a previous call to | |
`napi_set_instance_data()` will be overwritten. If a `finalize_cb` was provided | |
by the previous call, it will not be called. | |
-### napi_get_instance_data | |
+### napi\_get\_instance\_data | |
+ | |
<!-- YAML | |
added: | |
- v12.8.0 | |
@@ -542,7 +544,8 @@ Node-API exposes the following fundamental datatypes as abstractions that are | |
consumed by the various APIs. These APIs should be treated as opaque, | |
introspectable only with other Node-API calls. | |
-### napi_status | |
+### napi\_status | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -580,7 +584,8 @@ typedef enum { | |
If additional information is required upon an API returning a failed status, | |
it can be obtained by calling `napi_get_last_error_info`. | |
-### napi_extended_error_info | |
+### napi\_extended\_error\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -605,7 +610,7 @@ typedef struct { | |
See the [Error handling][] section for additional information. | |
-### napi_env | |
+### napi\_env | |
`napi_env` is used to represent a context that the underlying Node-API | |
implementation can use to persist VM-specific state. This structure is passed | |
@@ -619,11 +624,12 @@ when an instance of a native addon is unloaded. Notification of this event is | |
delivered through the callbacks given to [`napi_add_env_cleanup_hook`][] and | |
[`napi_set_instance_data`][]. | |
-### napi_value | |
+### napi\_value | |
This is an opaque pointer that is used to represent a JavaScript value. | |
-### napi_threadsafe_function | |
+### napi\_threadsafe\_function | |
+ | |
<!-- YAML | |
added: v10.6.0 | |
napiVersion: 4 | |
@@ -633,7 +639,8 @@ This is an opaque pointer that represents a JavaScript function which can be | |
called asynchronously from multiple threads via | |
`napi_call_threadsafe_function()`. | |
-### napi_threadsafe_function_release_mode | |
+### napi\_threadsafe\_function\_release\_mode | |
+ | |
<!-- YAML | |
added: v10.6.0 | |
napiVersion: 4 | |
@@ -651,7 +658,8 @@ typedef enum { | |
} napi_threadsafe_function_release_mode; | |
``` | |
-### napi_threadsafe_function_call_mode | |
+### napi\_threadsafe\_function\_call\_mode | |
+ | |
<!-- YAML | |
added: v10.6.0 | |
napiVersion: 4 | |
@@ -669,7 +677,8 @@ typedef enum { | |
``` | |
### Node-API memory management types | |
-#### napi_handle_scope | |
+ | |
+#### napi\_handle\_scope | |
This is an abstraction used to control and modify the lifetime of objects | |
created within a particular scope. In general, Node-API values are created | |
@@ -688,7 +697,8 @@ longer referenced from the current stack frame. | |
For more details, review the [Object lifetime management][]. | |
-#### napi_escapable_handle_scope | |
+#### napi\_escapable\_handle\_scope | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -696,7 +707,8 @@ napiVersion: 1 | |
Escapable handle scopes are a special type of handle scope to return values | |
created within a particular handle scope to a parent scope. | |
-#### napi_ref | |
+#### napi\_ref | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -707,7 +720,8 @@ minimum lifetimes explicitly. | |
For more details, review the [Object lifetime management][]. | |
-#### napi_type_tag | |
+#### napi\_type\_tag | |
+ | |
<!-- YAML | |
added: | |
- v14.8.0 | |
@@ -731,7 +745,8 @@ typedef struct { | |
} napi_type_tag; | |
``` | |
-#### napi_async_cleanup_hook_handle | |
+#### napi\_async\_cleanup\_hook\_handle | |
+ | |
<!-- YAML | |
added: | |
- v14.10.0 | |
@@ -744,7 +759,8 @@ events completes. | |
### Node-API callback types | |
-#### napi_callback_info | |
+#### napi\_callback\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -753,7 +770,8 @@ Opaque datatype that is passed to a callback function. It can be used for | |
getting additional information about the context in which the callback was | |
invoked. | |
-#### napi_callback | |
+#### napi\_callback | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -769,7 +788,8 @@ typedef napi_value (*napi_callback)(napi_env, napi_callback_info); | |
Unless for reasons discussed in [Object Lifetime Management][], creating a | |
handle and/or callback scope inside a `napi_callback` is not necessary. | |
-#### napi_finalize | |
+#### napi\_finalize | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -790,7 +811,8 @@ typedef void (*napi_finalize)(napi_env env, | |
Unless for reasons discussed in [Object Lifetime Management][], creating a | |
handle and/or callback scope inside the function body is not necessary. | |
-#### napi_async_execute_callback | |
+#### napi\_async\_execute\_callback | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -807,7 +830,8 @@ JavaScript or interact with JavaScript objects. Node-API calls should be in the | |
`napi_async_complete_callback` instead. Do not use the `napi_env` parameter as | |
it will likely result in execution of JavaScript. | |
-#### napi_async_complete_callback | |
+#### napi\_async\_complete\_callback | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -824,7 +849,8 @@ typedef void (*napi_async_complete_callback)(napi_env env, | |
Unless for reasons discussed in [Object Lifetime Management][], creating a | |
handle and/or callback scope inside the function body is not necessary. | |
-#### napi_threadsafe_function_call_js | |
+#### napi\_threadsafe\_function\_call\_js | |
+ | |
<!-- YAML | |
added: v10.6.0 | |
napiVersion: 4 | |
@@ -870,7 +896,8 @@ typedef void (*napi_threadsafe_function_call_js)(napi_env env, | |
Unless for reasons discussed in [Object Lifetime Management][], creating a | |
handle and/or callback scope inside the function body is not necessary. | |
-#### napi_async_cleanup_hook | |
+#### napi\_async\_cleanup\_hook | |
+ | |
<!-- YAML | |
added: | |
- v14.10.0 | |
@@ -955,7 +982,8 @@ Do not rely on the content or format of any of the extended information as it | |
is not subject to SemVer and may change at any time. It is intended only for | |
logging purposes. | |
-#### napi_get_last_error_info | |
+#### napi\_get\_last\_error\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1065,7 +1093,8 @@ is `'ERR_ERROR_1'` and a `TypeError` is being created the name will be: | |
TypeError [ERR_ERROR_1] | |
``` | |
-#### napi_throw | |
+#### napi\_throw | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1082,7 +1111,8 @@ Returns `napi_ok` if the API succeeded. | |
This API throws the JavaScript value provided. | |
-#### napi_throw_error | |
+#### napi\_throw\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1102,7 +1132,8 @@ Returns `napi_ok` if the API succeeded. | |
This API throws a JavaScript `Error` with the text provided. | |
-#### napi_throw_type_error | |
+#### napi\_throw\_type\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1122,7 +1153,8 @@ Returns `napi_ok` if the API succeeded. | |
This API throws a JavaScript `TypeError` with the text provided. | |
-#### napi_throw_range_error | |
+#### napi\_throw\_range\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1142,7 +1174,8 @@ Returns `napi_ok` if the API succeeded. | |
This API throws a JavaScript `RangeError` with the text provided. | |
-#### napi_is_error | |
+#### napi\_is\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1163,7 +1196,8 @@ Returns `napi_ok` if the API succeeded. | |
This API queries a `napi_value` to check if it represents an error object. | |
-#### napi_create_error | |
+#### napi\_create\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1187,7 +1221,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns a JavaScript `Error` with the text provided. | |
-#### napi_create_type_error | |
+#### napi\_create\_type\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1211,7 +1246,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns a JavaScript `TypeError` with the text provided. | |
-#### napi_create_range_error | |
+#### napi\_create\_range\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1235,7 +1271,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns a JavaScript `RangeError` with the text provided. | |
-#### napi_get_and_clear_last_exception | |
+#### napi\_get\_and\_clear\_last\_exception | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1253,7 +1290,8 @@ Returns `napi_ok` if the API succeeded. | |
This API can be called even if there is a pending JavaScript exception. | |
-#### napi_is_exception_pending | |
+#### napi\_is\_exception\_pending | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1270,7 +1308,8 @@ Returns `napi_ok` if the API succeeded. | |
This API can be called even if there is a pending JavaScript exception. | |
-#### napi_fatal_exception | |
+#### napi\_fatal\_exception | |
+ | |
<!-- YAML | |
added: v9.10.0 | |
napiVersion: 3 | |
@@ -1291,7 +1330,8 @@ callback throws an exception with no way to recover. | |
In the event of an unrecoverable error in a native module, a fatal error can be | |
thrown to immediately terminate the process. | |
-#### napi_fatal_error | |
+#### napi\_fatal\_error | |
+ | |
<!-- YAML | |
added: v8.2.0 | |
napiVersion: 1 | |
@@ -1405,7 +1446,8 @@ The methods available to open/close escapable scopes are | |
The request to promote a handle is made through [`napi_escape_handle`][] which | |
can only be called once. | |
-#### napi_open_handle_scope | |
+#### napi\_open\_handle\_scope | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1423,7 +1465,8 @@ Returns `napi_ok` if the API succeeded. | |
This API opens a new scope. | |
-#### napi_close_handle_scope | |
+#### napi\_close\_handle\_scope | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1444,7 +1487,8 @@ reverse order from which they were created. | |
This API can be called even if there is a pending JavaScript exception. | |
-#### napi_open_escapable_handle_scope | |
+#### napi\_open\_escapable\_handle\_scope | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1464,7 +1508,8 @@ Returns `napi_ok` if the API succeeded. | |
This API opens a new scope from which one object can be promoted | |
to the outer scope. | |
-#### napi_close_escapable_handle_scope | |
+#### napi\_close\_escapable\_handle\_scope | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1486,7 +1531,8 @@ reverse order from which they were created. | |
This API can be called even if there is a pending JavaScript exception. | |
-#### napi_escape_handle | |
+#### napi\_escape\_handle | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1553,7 +1599,8 @@ There can be multiple persistent references created which refer to the same | |
object, each of which will either keep the object live or not based on its | |
individual count. | |
-#### napi_create_reference | |
+#### napi\_create\_reference | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1577,7 +1624,8 @@ Returns `napi_ok` if the API succeeded. | |
This API creates a new reference with the specified reference count | |
to the `Object` passed in. | |
-#### napi_delete_reference | |
+#### napi\_delete\_reference | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1596,7 +1644,8 @@ This API deletes the reference passed in. | |
This API can be called even if there is a pending JavaScript exception. | |
-#### napi_reference_ref | |
+#### napi\_reference\_ref | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1617,7 +1666,8 @@ Returns `napi_ok` if the API succeeded. | |
This API increments the reference count for the reference | |
passed in and returns the resulting reference count. | |
-#### napi_reference_unref | |
+#### napi\_reference\_unref | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1638,7 +1688,8 @@ Returns `napi_ok` if the API succeeded. | |
This API decrements the reference count for the reference | |
passed in and returns the resulting reference count. | |
-#### napi_get_reference_value | |
+#### napi\_get\_reference\_value | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -1674,7 +1725,8 @@ Node-API provides functions for registering and un-registering such callbacks. | |
When those callbacks are run, all resources that are being held by the addon | |
should be freed up. | |
-#### napi_add_env_cleanup_hook | |
+#### napi\_add\_env\_cleanup\_hook | |
+ | |
<!-- YAML | |
added: v10.2.0 | |
napiVersion: 3 | |
@@ -1703,7 +1755,8 @@ is being torn down anyway. | |
For asynchronous cleanup, [`napi_add_async_cleanup_hook`][] is available. | |
-#### napi_remove_env_cleanup_hook | |
+#### napi\_remove\_env\_cleanup\_hook | |
+ | |
<!-- YAML | |
added: v10.2.0 | |
napiVersion: 3 | |
@@ -1722,7 +1775,8 @@ need to be exact matches. | |
The function must have originally been registered | |
with `napi_add_env_cleanup_hook`, otherwise the process will abort. | |
-#### napi_add_async_cleanup_hook | |
+#### napi\_add\_async\_cleanup\_hook | |
+ | |
<!-- YAML | |
added: | |
- v14.8.0 | |
@@ -1764,7 +1818,8 @@ regardless of whether the hook has already been invoked. | |
Typically, that happens when the resource for which this hook was added | |
is being torn down anyway. | |
-#### napi_remove_async_cleanup_hook | |
+#### napi\_remove\_async\_cleanup\_hook | |
+ | |
<!-- YAML | |
added: | |
- v14.8.0 | |
@@ -1924,7 +1981,9 @@ However, for better performance, it's better for the caller to make sure that | |
the `napi_value` in question is of the JavaScript type expected by the API. | |
### Enum types | |
-#### napi_key_collection_mode | |
+ | |
+#### napi\_key\_collection\_mode | |
+ | |
<!-- YAML | |
added: | |
- v13.7.0 | |
@@ -1948,7 +2007,8 @@ Describes the `Keys/Properties` filter enums: | |
object only. `napi_key_include_prototypes` will include all keys | |
of the objects's prototype chain as well. | |
-#### napi_key_filter | |
+#### napi\_key\_filter | |
+ | |
<!-- YAML | |
added: | |
- v13.7.0 | |
@@ -1970,7 +2030,8 @@ typedef enum { | |
Property filter bits. They can be or'ed to build a composite filter. | |
-#### napi_key_conversion | |
+#### napi\_key\_conversion | |
+ | |
<!-- YAML | |
added: | |
- v13.7.0 | |
@@ -1990,7 +2051,7 @@ typedef enum { | |
strings. `napi_key_keep_numbers` will return numbers for integer | |
indices. | |
-#### napi_valuetype | |
+#### napi\_valuetype | |
```c | |
typedef enum { | |
@@ -2016,7 +2077,7 @@ In addition to types in that section, `napi_valuetype` can also represent | |
A JavaScript value of type `napi_external` appears in JavaScript as a plain | |
object such that no properties can be set on it, and no prototype. | |
-#### napi_typedarray_type | |
+#### napi\_typedarray\_type | |
```c | |
typedef enum { | |
@@ -2039,7 +2100,9 @@ Elements of this enum correspond to | |
[Section 22.2][] of the [ECMAScript Language Specification][]. | |
### Object creation functions | |
-#### napi_create_array | |
+ | |
+#### napi\_create\_array | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2058,7 +2121,8 @@ This API returns a Node-API value corresponding to a JavaScript `Array` type. | |
JavaScript arrays are described in | |
[Section 22.1][] of the ECMAScript Language Specification. | |
-#### napi_create_array_with_length | |
+#### napi\_create\_array\_with\_length | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2087,7 +2151,8 @@ directly read and/or written via C, consider using | |
JavaScript arrays are described in | |
[Section 22.1][] of the ECMAScript Language Specification. | |
-#### napi_create_arraybuffer | |
+#### napi\_create\_arraybuffer | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2120,7 +2185,8 @@ a typed array or `DataView` object would need to be created. | |
JavaScript `ArrayBuffer` objects are described in | |
[Section 24.1][] of the ECMAScript Language Specification. | |
-#### napi_create_buffer | |
+#### napi\_create\_buffer | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2143,7 +2209,8 @@ Returns `napi_ok` if the API succeeded. | |
This API allocates a `node::Buffer` object. While this is still a | |
fully-supported data structure, in most cases using a `TypedArray` will suffice. | |
-#### napi_create_buffer_copy | |
+#### napi\_create\_buffer\_copy | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2170,7 +2237,8 @@ This API allocates a `node::Buffer` object and initializes it with data copied | |
from the passed-in buffer. While this is still a fully-supported data | |
structure, in most cases using a `TypedArray` will suffice. | |
-#### napi_create_date | |
+#### napi\_create\_date | |
+ | |
<!-- YAML | |
added: | |
- v11.11.0 | |
@@ -2198,7 +2266,8 @@ This API allocates a JavaScript `Date` object. | |
JavaScript `Date` objects are described in | |
[Section 20.3][] of the ECMAScript Language Specification. | |
-#### napi_create_external | |
+#### napi\_create\_external | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2238,7 +2307,8 @@ The created value is not an object, and therefore does not support additional | |
properties. It is considered a distinct value type: calling `napi_typeof()` with | |
an external value yields `napi_external`. | |
-#### napi_create_external_arraybuffer | |
+#### napi\_create\_external\_arraybuffer | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2282,7 +2352,8 @@ object just created is ready for garbage collection. It is similar to | |
JavaScript `ArrayBuffer`s are described in | |
[Section 24.1][] of the ECMAScript Language Specification. | |
-#### napi_create_external_buffer | |
+#### napi\_create\_external\_buffer | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2323,7 +2394,8 @@ object just created is ready for garbage collection. It is similar to | |
For Node.js >=4 `Buffers` are `Uint8Array`s. | |
-#### napi_create_object | |
+#### napi\_create\_object | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2344,7 +2416,8 @@ It is the equivalent of doing `new Object()` in JavaScript. | |
The JavaScript `Object` type is described in [Section 6.1.7][] of the | |
ECMAScript Language Specification. | |
-#### napi_create_symbol | |
+#### napi\_create\_symbol | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2368,7 +2441,8 @@ This API creates a JavaScript `symbol` value from a UTF8-encoded C string. | |
The JavaScript `symbol` type is described in [Section 19.4][] | |
of the ECMAScript Language Specification. | |
-#### napi_create_typedarray | |
+#### napi\_create\_typedarray | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2405,7 +2479,8 @@ is raised. | |
JavaScript `TypedArray` objects are described in | |
[Section 22.2][] of the ECMAScript Language Specification. | |
-#### napi_create_dataview | |
+#### napi\_create\_dataview | |
+ | |
<!-- YAML | |
added: v8.3.0 | |
napiVersion: 1 | |
@@ -2440,7 +2515,9 @@ JavaScript `DataView` objects are described in | |
[Section 24.3][] of the ECMAScript Language Specification. | |
### Functions to convert from C types to Node-API | |
-#### napi_create_int32 | |
+ | |
+#### napi\_create\_int32 | |
+ | |
<!-- YAML | |
added: v8.4.0 | |
napiVersion: 1 | |
@@ -2462,7 +2539,8 @@ This API is used to convert from the C `int32_t` type to the JavaScript | |
The JavaScript `number` type is described in | |
[Section 6.1.6][] of the ECMAScript Language Specification. | |
-#### napi_create_uint32 | |
+#### napi\_create\_uint32 | |
+ | |
<!-- YAML | |
added: v8.4.0 | |
napiVersion: 1 | |
@@ -2484,7 +2562,8 @@ This API is used to convert from the C `uint32_t` type to the JavaScript | |
The JavaScript `number` type is described in | |
[Section 6.1.6][] of the ECMAScript Language Specification. | |
-#### napi_create_int64 | |
+#### napi\_create\_int64 | |
+ | |
<!-- YAML | |
added: v8.4.0 | |
napiVersion: 1 | |
@@ -2509,7 +2588,8 @@ cannot be represented with full precision in JavaScript. Integer values | |
outside the range of [`Number.MIN_SAFE_INTEGER`][] `-(2**53 - 1)` - | |
[`Number.MAX_SAFE_INTEGER`][] `(2**53 - 1)` will lose precision. | |
-#### napi_create_double | |
+#### napi\_create\_double | |
+ | |
<!-- YAML | |
added: v8.4.0 | |
napiVersion: 1 | |
@@ -2531,7 +2611,8 @@ This API is used to convert from the C `double` type to the JavaScript | |
The JavaScript `number` type is described in | |
[Section 6.1.6][] of the ECMAScript Language Specification. | |
-#### napi_create_bigint_int64 | |
+#### napi\_create\_bigint\_int64 | |
+ | |
<!-- YAML | |
added: v10.7.0 | |
napiVersion: 6 | |
@@ -2551,7 +2632,8 @@ Returns `napi_ok` if the API succeeded. | |
This API converts the C `int64_t` type to the JavaScript `BigInt` type. | |
-#### napi_create_bigint_uint64 | |
+#### napi\_create\_bigint\_uint64 | |
+ | |
<!-- YAML | |
added: v10.7.0 | |
napiVersion: 6 | |
@@ -2571,7 +2653,8 @@ Returns `napi_ok` if the API succeeded. | |
This API converts the C `uint64_t` type to the JavaScript `BigInt` type. | |
-#### napi_create_bigint_words | |
+#### napi\_create\_bigint\_words | |
+ | |
<!-- YAML | |
added: v10.7.0 | |
napiVersion: 6 | |
@@ -2600,7 +2683,8 @@ value. | |
The resulting `BigInt` is calculated as: (–1)<sup>`sign_bit`</sup> (`words[0]` | |
× (2<sup>64</sup>)<sup>0</sup> + `words[1]` × (2<sup>64</sup>)<sup>1</sup> + …) | |
-#### napi_create_string_latin1 | |
+#### napi\_create\_string\_latin1 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2627,7 +2711,8 @@ string. The native string is copied. | |
The JavaScript `string` type is described in | |
[Section 6.1.4][] of the ECMAScript Language Specification. | |
-#### napi_create_string_utf16 | |
+#### napi\_create\_string\_utf16 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2654,7 +2739,8 @@ The native string is copied. | |
The JavaScript `string` type is described in | |
[Section 6.1.4][] of the ECMAScript Language Specification. | |
-#### napi_create_string_utf8 | |
+#### napi\_create\_string\_utf8 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2682,7 +2768,9 @@ The JavaScript `string` type is described in | |
[Section 6.1.4][] of the ECMAScript Language Specification. | |
### Functions to convert from Node-API to C types | |
-#### napi_get_array_length | |
+ | |
+#### napi\_get\_array\_length | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2706,7 +2794,8 @@ This API returns the length of an array. | |
`Array` length is described in [Section 22.1.4.1][] of the ECMAScript Language | |
Specification. | |
-#### napi_get_arraybuffer_info | |
+#### napi\_get\_arraybuffer\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2721,7 +2810,7 @@ napi_status napi_get_arraybuffer_info(napi_env env, | |
* `[in] env`: The environment that the API is invoked under. | |
* `[in] arraybuffer`: `napi_value` representing the `ArrayBuffer` being queried. | |
-* `[out] data`: The underlying data buffer of the `ArrayBuffer`. If byte_length | |
+* `[out] data`: The underlying data buffer of the `ArrayBuffer`. If byte\_length | |
is `0`, this may be `NULL` or any other pointer value. | |
* `[out] byte_length`: Length in bytes of the underlying data buffer. | |
@@ -2730,7 +2819,7 @@ Returns `napi_ok` if the API succeeded. | |
This API is used to retrieve the underlying data buffer of an `ArrayBuffer` and | |
its length. | |
-*WARNING*: Use caution while using this API. The lifetime of the underlying data | |
+_WARNING_: Use caution while using this API. The lifetime of the underlying data | |
buffer is managed by the `ArrayBuffer` even after it's returned. A | |
possible safe way to use this API is in conjunction with | |
[`napi_create_reference`][], which can be used to guarantee control over the | |
@@ -2738,7 +2827,8 @@ lifetime of the `ArrayBuffer`. It's also safe to use the returned data buffer | |
within the same callback as long as there are no calls to other APIs that might | |
trigger a GC. | |
-#### napi_get_buffer_info | |
+#### napi\_get\_buffer\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2762,10 +2852,11 @@ Returns `napi_ok` if the API succeeded. | |
This API is used to retrieve the underlying data buffer of a `node::Buffer` | |
and its length. | |
-*Warning*: Use caution while using this API since the underlying data buffer's | |
+_Warning_: Use caution while using this API since the underlying data buffer's | |
lifetime is not guaranteed if it's managed by the VM. | |
-#### napi_get_prototype | |
+#### napi\_get\_prototype | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2785,7 +2876,8 @@ napi_status napi_get_prototype(napi_env env, | |
Returns `napi_ok` if the API succeeded. | |
-#### napi_get_typedarray_info | |
+#### napi\_get\_typedarray\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2821,10 +2913,11 @@ Returns `napi_ok` if the API succeeded. | |
This API returns various properties of a typed array. | |
-*Warning*: Use caution while using this API since the underlying data buffer | |
+_Warning_: Use caution while using this API since the underlying data buffer | |
is managed by the VM. | |
-#### napi_get_dataview_info | |
+#### napi\_get\_dataview\_info | |
+ | |
<!-- YAML | |
added: v8.3.0 | |
napiVersion: 1 | |
@@ -2844,7 +2937,7 @@ napi_status napi_get_dataview_info(napi_env env, | |
properties to query. | |
* `[out] byte_length`: Number of bytes in the `DataView`. | |
* `[out] data`: The data buffer underlying the `DataView`. | |
- If byte_length is `0`, this may be `NULL` or any other pointer value. | |
+ If byte\_length is `0`, this may be `NULL` or any other pointer value. | |
* `[out] arraybuffer`: `ArrayBuffer` underlying the `DataView`. | |
* `[out] byte_offset`: The byte offset within the data buffer from which | |
to start projecting the `DataView`. | |
@@ -2853,7 +2946,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns various properties of a `DataView`. | |
-#### napi_get_date_value | |
+#### napi\_get\_date\_value | |
+ | |
<!-- YAML | |
added: | |
- v11.11.0 | |
@@ -2881,7 +2975,8 @@ in it returns `napi_date_expected`. | |
This API returns the C double primitive of time value for the given JavaScript | |
`Date`. | |
-#### napi_get_value_bool | |
+#### napi\_get\_value\_bool | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2902,7 +2997,8 @@ passed in it returns `napi_boolean_expected`. | |
This API returns the C boolean primitive equivalent of the given JavaScript | |
`Boolean`. | |
-#### napi_get_value_double | |
+#### napi\_get\_value\_double | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -2925,7 +3021,8 @@ in it returns `napi_number_expected`. | |
This API returns the C double primitive equivalent of the given JavaScript | |
`number`. | |
-#### napi_get_value_bigint_int64 | |
+#### napi\_get\_value\_bigint\_int64 | |
+ | |
<!-- YAML | |
added: v10.7.0 | |
napiVersion: 6 | |
@@ -2951,7 +3048,8 @@ returns `napi_bigint_expected`. | |
This API returns the C `int64_t` primitive equivalent of the given JavaScript | |
`BigInt`. If needed it will truncate the value, setting `lossless` to `false`. | |
-#### napi_get_value_bigint_uint64 | |
+#### napi\_get\_value\_bigint\_uint64 | |
+ | |
<!-- YAML | |
added: v10.7.0 | |
napiVersion: 6 | |
@@ -2977,7 +3075,8 @@ returns `napi_bigint_expected`. | |
This API returns the C `uint64_t` primitive equivalent of the given JavaScript | |
`BigInt`. If needed it will truncate the value, setting `lossless` to `false`. | |
-#### napi_get_value_bigint_words | |
+#### napi\_get\_value\_bigint\_words | |
+ | |
<!-- YAML | |
added: v10.7.0 | |
napiVersion: 6 | |
@@ -2994,10 +3093,10 @@ napi_status napi_get_value_bigint_words(napi_env env, | |
* `[in] env`: The environment that the API is invoked under. | |
* `[in] value`: `napi_value` representing JavaScript `BigInt`. | |
* `[out] sign_bit`: Integer representing if the JavaScript `BigInt` is positive | |
- or negative. | |
+ or negative. | |
* `[in/out] word_count`: Must be initialized to the length of the `words` | |
- array. Upon return, it will be set to the actual number of words that | |
- would be needed to store this `BigInt`. | |
+ array. Upon return, it will be set to the actual number of words that | |
+ would be needed to store this `BigInt`. | |
* `[out] words`: Pointer to a pre-allocated 64-bit word array. | |
Returns `napi_ok` if the API succeeded. | |
@@ -3006,7 +3105,8 @@ This API converts a single `BigInt` value into a sign bit, 64-bit little-endian | |
array, and the number of elements in the array. `sign_bit` and `words` may be | |
both set to `NULL`, in order to get only `word_count`. | |
-#### napi_get_value_external | |
+#### napi\_get\_value\_external | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3028,7 +3128,8 @@ passed in it returns `napi_invalid_arg`. | |
This API retrieves the external data pointer that was previously passed to | |
`napi_create_external()`. | |
-#### napi_get_value_int32 | |
+#### napi\_get\_value\_int32 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3058,7 +3159,8 @@ positive number becoming a negative number if the value is > 2<sup>31</sup> - 1. | |
Non-finite number values (`NaN`, `+Infinity`, or `-Infinity`) set the | |
result to zero. | |
-#### napi_get_value_int64 | |
+#### napi\_get\_value\_int64 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3088,7 +3190,8 @@ precision. | |
Non-finite number values (`NaN`, `+Infinity`, or `-Infinity`) set the | |
result to zero. | |
-#### napi_get_value_string_latin1 | |
+#### napi\_get\_value\_string\_latin1 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3118,7 +3221,8 @@ is passed in it returns `napi_string_expected`. | |
This API returns the ISO-8859-1-encoded string corresponding the value passed | |
in. | |
-#### napi_get_value_string_utf8 | |
+#### napi\_get\_value\_string\_utf8 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3147,7 +3251,8 @@ is passed in it returns `napi_string_expected`. | |
This API returns the UTF8-encoded string corresponding the value passed in. | |
-#### napi_get_value_string_utf16 | |
+#### napi\_get\_value\_string\_utf16 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3176,7 +3281,8 @@ is passed in it returns `napi_string_expected`. | |
This API returns the UTF16-encoded string corresponding the value passed in. | |
-#### napi_get_value_uint32 | |
+#### napi\_get\_value\_uint32 | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3200,7 +3306,9 @@ This API returns the C primitive equivalent of the given `napi_value` as a | |
`uint32_t`. | |
### Functions to get global instances | |
-#### napi_get_boolean | |
+ | |
+#### napi\_get\_boolean | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3220,7 +3328,8 @@ Returns `napi_ok` if the API succeeded. | |
This API is used to return the JavaScript singleton object that is used to | |
represent the given boolean value. | |
-#### napi_get_global | |
+#### napi\_get\_global | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3237,7 +3346,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns the `global` object. | |
-#### napi_get_null | |
+#### napi\_get\_null | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3254,7 +3364,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns the `null` object. | |
-#### napi_get_undefined | |
+#### napi\_get\_undefined | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3284,7 +3395,8 @@ These APIs support doing one of the following: | |
2. Check the type of a JavaScript value. | |
3. Check for equality between two JavaScript values. | |
-### napi_coerce_to_bool | |
+### napi\_coerce\_to\_bool | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3305,7 +3417,8 @@ Returns `napi_ok` if the API succeeded. | |
This API implements the abstract operation `ToBoolean()` as defined in | |
[Section 7.1.2][] of the ECMAScript Language Specification. | |
-### napi_coerce_to_number | |
+### napi\_coerce\_to\_number | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3328,7 +3441,8 @@ This API implements the abstract operation `ToNumber()` as defined in | |
This function potentially runs JS code if the passed-in value is an | |
object. | |
-### napi_coerce_to_object | |
+### napi\_coerce\_to\_object | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3349,7 +3463,8 @@ Returns `napi_ok` if the API succeeded. | |
This API implements the abstract operation `ToObject()` as defined in | |
[Section 7.1.13][] of the ECMAScript Language Specification. | |
-### napi_coerce_to_string | |
+### napi\_coerce\_to\_string | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3372,7 +3487,8 @@ This API implements the abstract operation `ToString()` as defined in | |
This function potentially runs JS code if the passed-in value is an | |
object. | |
-### napi_typeof | |
+### napi\_typeof | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3401,7 +3517,8 @@ Specification. However, there are some differences: | |
If `value` has a type that is invalid, an error is returned. | |
-### napi_instanceof | |
+### napi\_instanceof | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3426,7 +3543,8 @@ Returns `napi_ok` if the API succeeded. | |
This API represents invoking the `instanceof` Operator on the object as | |
defined in [Section 12.10.4][] of the ECMAScript Language Specification. | |
-### napi_is_array | |
+### napi\_is\_array | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3445,7 +3563,8 @@ Returns `napi_ok` if the API succeeded. | |
This API represents invoking the `IsArray` operation on the object | |
as defined in [Section 7.2.2][] of the ECMAScript Language Specification. | |
-### napi_is_arraybuffer | |
+### napi\_is\_arraybuffer | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3463,7 +3582,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in is an array buffer. | |
-### napi_is_buffer | |
+### napi\_is\_buffer | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3482,7 +3602,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in is a buffer. | |
-### napi_is_date | |
+### napi\_is\_date | |
+ | |
<!-- YAML | |
added: | |
- v11.11.0 | |
@@ -3503,7 +3624,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in is a date. | |
-### napi_is_error | |
+### napi\_is\_error | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3521,7 +3643,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in is an `Error`. | |
-### napi_is_typedarray | |
+### napi\_is\_typedarray | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3539,7 +3662,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in is a typed array. | |
-### napi_is_dataview | |
+### napi\_is\_dataview | |
+ | |
<!-- YAML | |
added: v8.3.0 | |
napiVersion: 1 | |
@@ -3557,7 +3681,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in is a `DataView`. | |
-### napi_strict_equals | |
+### napi\_strict\_equals | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3580,7 +3705,8 @@ Returns `napi_ok` if the API succeeded. | |
This API represents the invocation of the Strict Equality algorithm as | |
defined in [Section 7.2.14][] of the ECMAScript Language Specification. | |
-### napi_detach_arraybuffer | |
+### napi\_detach\_arraybuffer | |
+ | |
<!-- YAML | |
added: | |
- v13.0.0 | |
@@ -3608,7 +3734,8 @@ that is, created with [`napi_create_external_arraybuffer`][]. | |
This API represents the invocation of the `ArrayBuffer` detach operation as | |
defined in [Section 24.1.1.3][] of the ECMAScript Language Specification. | |
-### napi_is_detached_arraybuffer | |
+### napi\_is\_detached\_arraybuffer | |
+ | |
<!-- YAML | |
added: | |
- v13.3.0 | |
@@ -3776,7 +3903,9 @@ if (status != napi_ok) return status; | |
``` | |
### Structures | |
-#### napi_property_attributes | |
+ | |
+#### napi\_property\_attributes | |
+ | |
<!-- YAML | |
changes: | |
- version: v14.12.0 | |
@@ -3825,7 +3954,7 @@ They can be one or more of the following bitflags: | |
* `napi_default_jsproperty`: Like a property set via assignment in JavaScript, | |
the property is writable, enumerable, and configurable. | |
-#### napi_property_descriptor | |
+#### napi\_property\_descriptor | |
```c | |
typedef struct { | |
@@ -3872,7 +4001,9 @@ typedef struct { | |
function is invoked. | |
### Functions | |
-#### napi_get_property_names | |
+ | |
+#### napi\_get\_property\_names | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3897,7 +4028,8 @@ This API returns the names of the enumerable properties of `object` as an array | |
of strings. The properties of `object` whose key is a symbol will not be | |
included. | |
-#### napi_get_all_property_names | |
+#### napi\_get\_all\_property\_names | |
+ | |
<!-- YAML | |
added: | |
- v13.7.0 | |
@@ -3930,7 +4062,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns an array containing the names of the available properties | |
of this object. | |
-#### napi_set_property | |
+#### napi\_set\_property | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3952,7 +4085,8 @@ Returns `napi_ok` if the API succeeded. | |
This API set a property on the `Object` passed in. | |
-#### napi_get_property | |
+#### napi\_get\_property | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3974,7 +4108,8 @@ Returns `napi_ok` if the API succeeded. | |
This API gets the requested property from the `Object` passed in. | |
-#### napi_has_property | |
+#### napi\_has\_property | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -3996,7 +4131,8 @@ Returns `napi_ok` if the API succeeded. | |
This API checks if the `Object` passed in has the named property. | |
-#### napi_delete_property | |
+#### napi\_delete\_property | |
+ | |
<!-- YAML | |
added: v8.2.0 | |
napiVersion: 1 | |
@@ -4019,7 +4155,8 @@ Returns `napi_ok` if the API succeeded. | |
This API attempts to delete the `key` own property from `object`. | |
-#### napi_has_own_property | |
+#### napi\_has\_own\_property | |
+ | |
<!-- YAML | |
added: v8.2.0 | |
napiVersion: 1 | |
@@ -4043,7 +4180,8 @@ This API checks if the `Object` passed in has the named own property. `key` must | |
be a `string` or a `symbol`, or an error will be thrown. Node-API will not | |
perform any conversion between data types. | |
-#### napi_set_named_property | |
+#### napi\_set\_named\_property | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4066,7 +4204,8 @@ Returns `napi_ok` if the API succeeded. | |
This method is equivalent to calling [`napi_set_property`][] with a `napi_value` | |
created from the string passed in as `utf8Name`. | |
-#### napi_get_named_property | |
+#### napi\_get\_named\_property | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4089,7 +4228,8 @@ Returns `napi_ok` if the API succeeded. | |
This method is equivalent to calling [`napi_get_property`][] with a `napi_value` | |
created from the string passed in as `utf8Name`. | |
-#### napi_has_named_property | |
+#### napi\_has\_named\_property | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4112,7 +4252,8 @@ Returns `napi_ok` if the API succeeded. | |
This method is equivalent to calling [`napi_has_property`][] with a `napi_value` | |
created from the string passed in as `utf8Name`. | |
-#### napi_set_element | |
+#### napi\_set\_element | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4134,7 +4275,8 @@ Returns `napi_ok` if the API succeeded. | |
This API sets an element on the `Object` passed in. | |
-#### napi_get_element | |
+#### napi\_get\_element | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4156,7 +4298,8 @@ Returns `napi_ok` if the API succeeded. | |
This API gets the element at the requested index. | |
-#### napi_has_element | |
+#### napi\_has\_element | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4179,7 +4322,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns if the `Object` passed in has an element at the | |
requested index. | |
-#### napi_delete_element | |
+#### napi\_delete\_element | |
+ | |
<!-- YAML | |
added: v8.2.0 | |
napiVersion: 1 | |
@@ -4202,7 +4346,8 @@ Returns `napi_ok` if the API succeeded. | |
This API attempts to delete the specified `index` from `object`. | |
-#### napi_define_properties | |
+#### napi\_define\_properties | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4229,7 +4374,8 @@ this API will set the properties on the object one at a time, as defined by | |
`DefineOwnProperty()` (described in [Section 9.1.6][] of the ECMA-262 | |
specification). | |
-#### napi_object_freeze | |
+#### napi\_object\_freeze | |
+ | |
<!-- YAML | |
added: | |
- v14.14.0 | |
@@ -4255,7 +4401,8 @@ It also prevents the object's prototype from being changed. This is described | |
in [Section 19.1.2.6](https://tc39.es/ecma262/#sec-object.freeze) of the | |
ECMA-262 specification. | |
-#### napi_object_seal | |
+#### napi\_object\_seal | |
+ | |
<!-- YAML | |
added: | |
- v14.14.0 | |
@@ -4302,7 +4449,8 @@ Any non-`NULL` data which is passed to this API via the `data` field of the | |
whenever `object` is garbage-collected by passing both `object` and the data to | |
[`napi_add_finalizer`][]. | |
-### napi_call_function | |
+### napi\_call\_function | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4328,8 +4476,8 @@ NAPI_EXTERN napi_status napi_call_function(napi_env env, | |
Returns `napi_ok` if the API succeeded. | |
This method allows a JavaScript function object to be called from a native | |
-add-on. This is the primary mechanism of calling back *from* the add-on's | |
-native code *into* JavaScript. For the special case of calling into JavaScript | |
+add-on. This is the primary mechanism of calling back _from_ the add-on's | |
+native code _into_ JavaScript. For the special case of calling into JavaScript | |
after an async operation, see [`napi_make_callback`][]. | |
A sample use case might look as follows. Consider the following JavaScript | |
@@ -4371,7 +4519,8 @@ status = napi_get_value_int32(env, return_val, &result); | |
if (status != napi_ok) return; | |
``` | |
-### napi_create_function | |
+### napi\_create\_function | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4401,8 +4550,8 @@ napi_status napi_create_function(napi_env env, | |
Returns `napi_ok` if the API succeeded. | |
This API allows an add-on author to create a function object in native code. | |
-This is the primary mechanism to allow calling *into* the add-on's native code | |
-*from* JavaScript. | |
+This is the primary mechanism to allow calling _into_ the add-on's native code | |
+_from_ JavaScript. | |
The newly created function is not automatically visible from script after this | |
call. Instead, a property must be explicitly set on any object that is visible | |
@@ -4452,7 +4601,8 @@ passing both the JavaScript function and the data to [`napi_add_finalizer`][]. | |
JavaScript `Function`s are described in [Section 19.2][] of the ECMAScript | |
Language Specification. | |
-### napi_get_cb_info | |
+### napi\_get\_cb\_info | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4484,7 +4634,8 @@ Returns `napi_ok` if the API succeeded. | |
This method is used within a callback function to retrieve details about the | |
call like the arguments and the `this` pointer from a given callback info. | |
-### napi_get_new_target | |
+### napi\_get\_new\_target | |
+ | |
<!-- YAML | |
added: v8.6.0 | |
napiVersion: 1 | |
@@ -4505,7 +4656,8 @@ Returns `napi_ok` if the API succeeded. | |
This API returns the `new.target` of the constructor call. If the current | |
callback is not a constructor call, the result is `NULL`. | |
-### napi_new_instance | |
+### napi\_new\_instance | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4571,15 +4723,15 @@ Node-API offers a way to "wrap" C++ classes and instances so that the class | |
constructor and methods can be called from JavaScript. | |
1. The [`napi_define_class`][] API defines a JavaScript class with constructor, | |
- static properties and methods, and instance properties and methods that | |
- correspond to the C++ class. | |
+ static properties and methods, and instance properties and methods that | |
+ correspond to the C++ class. | |
2. When JavaScript code invokes the constructor, the constructor callback | |
- uses [`napi_wrap`][] to wrap a new C++ instance in a JavaScript object, | |
- then returns the wrapper object. | |
+ uses [`napi_wrap`][] to wrap a new C++ instance in a JavaScript object, | |
+ then returns the wrapper object. | |
3. When JavaScript code invokes a method or property accessor on the class, | |
- the corresponding `napi_callback` C++ function is invoked. For an instance | |
- callback, [`napi_unwrap`][] obtains the C++ instance that is the target of | |
- the call. | |
+ the corresponding `napi_callback` C++ function is invoked. For an instance | |
+ callback, [`napi_unwrap`][] obtains the C++ instance that is the target of | |
+ the call. | |
For wrapped objects it may be difficult to distinguish between a function | |
called on a class prototype and a function called on an instance of a class. | |
@@ -4739,7 +4891,8 @@ query(napi_env env, napi_callback_info info) { | |
} | |
``` | |
-### napi_define_class | |
+### napi\_define\_class | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4811,7 +4964,8 @@ with the resulting JavaScript constructor (which is returned in the `result` | |
parameter) and freed whenever the class is garbage-collected by passing both | |
the JavaScript function and the data to [`napi_add_finalizer`][]. | |
-### napi_wrap | |
+### napi\_wrap | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4859,7 +5013,7 @@ The optional returned reference is initially a weak reference, meaning it | |
has a reference count of 0. Typically this reference count would be incremented | |
temporarily during async operations that require the instance to remain valid. | |
-*Caution*: The optional returned reference (if obtained) should be deleted via | |
+_Caution_: The optional returned reference (if obtained) should be deleted via | |
[`napi_delete_reference`][] ONLY in response to the finalize callback | |
invocation. If it is deleted before then, then the finalize callback may never | |
be invoked. Therefore, when obtaining a reference a finalize callback is also | |
@@ -4869,7 +5023,8 @@ Calling `napi_wrap()` a second time on an object will return an error. To | |
associate another native instance with the object, use `napi_remove_wrap()` | |
first. | |
-### napi_unwrap | |
+### napi\_unwrap | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -4896,7 +5051,8 @@ method or accessor, then the `this` argument to the callback is the wrapper | |
object; the wrapped C++ instance that is the target of the call can be obtained | |
then by calling `napi_unwrap()` on the wrapper object. | |
-### napi_remove_wrap | |
+### napi\_remove\_wrap | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -4919,7 +5075,8 @@ object `js_object` using `napi_wrap()` and removes the wrapping. If a finalize | |
callback was associated with the wrapping, it will no longer be called when the | |
JavaScript object becomes garbage-collected. | |
-### napi_type_tag_object | |
+### napi\_type\_tag\_object | |
+ | |
<!-- YAML | |
added: | |
- v14.8.0 | |
@@ -4947,7 +5104,8 @@ has the right type. | |
If the object already has an associated type tag, this API will return | |
`napi_invalid_arg`. | |
-### napi_check_object_type_tag | |
+### napi\_check\_object\_type\_tag | |
+ | |
<!-- YAML | |
added: | |
- v14.8.0 | |
@@ -4975,7 +5133,7 @@ Compares the pointer given as `type_tag` with any that can be found on | |
not match `type_tag`, then `result` is set to `false`. If a tag is found and it | |
matches `type_tag`, then `result` is set to `true`. | |
-### napi_add_finalizer | |
+### napi\_add\_finalizer | |
<!-- YAML | |
added: v8.0.0 | |
@@ -5015,7 +5173,7 @@ in `js_object` is ready for garbage collection. This API is similar to | |
attach each of them to the JavaScript object, and | |
* the object manipulated by the API can be used with `napi_wrap()`. | |
-*Caution*: The optional returned reference (if obtained) should be deleted via | |
+_Caution_: The optional returned reference (if obtained) should be deleted via | |
[`napi_delete_reference`][] ONLY in response to the finalize callback | |
invocation. If it is deleted before then, then the finalize callback may never | |
be invoked. Therefore, when obtaining a reference a finalize callback is also | |
@@ -5076,7 +5234,8 @@ will be invoked with a status value of `napi_cancelled`. | |
The work should not be deleted before the `complete` | |
callback invocation, even when it was cancelled. | |
-### napi_create_async_work | |
+### napi\_create\_async\_work | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -5126,7 +5285,8 @@ representative of the type of async work being performed. It is also recommended | |
to apply namespacing to the identifier, e.g. by including the module name. See | |
the [`async_hooks` documentation][async_hooks `type`] for more information. | |
-### napi_delete_async_work | |
+### napi\_delete\_async\_work | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -5146,7 +5306,8 @@ This API frees a previously allocated work object. | |
This API can be called even if there is a pending JavaScript exception. | |
-### napi_queue_async_work | |
+### napi\_queue\_async\_work | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -5166,7 +5327,8 @@ This API requests that the previously allocated work be scheduled | |
for execution. Once it returns successfully, this API must not be called again | |
with the same `napi_async_work` item or the result will be undefined. | |
-### napi_cancel_async_work | |
+### napi\_cancel\_async\_work | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -5198,7 +5360,8 @@ scenario. When using any other asynchronous mechanism, the following APIs | |
are necessary to ensure an asynchronous operation is properly tracked by | |
the runtime. | |
-### napi_async_init | |
+### napi\_async\_init | |
+ | |
<!-- YAML | |
added: v8.6.0 | |
napiVersion: 1 | |
@@ -5238,7 +5401,8 @@ recommended as this will result poor results with `async_hooks` | |
now required by the underlying `async_hooks` implementation in order to provide | |
the linkage between async callbacks. | |
-### napi_async_destroy | |
+### napi\_async\_destroy | |
+ | |
<!-- YAML | |
added: v8.6.0 | |
napiVersion: 1 | |
@@ -5256,7 +5420,8 @@ Returns `napi_ok` if the API succeeded. | |
This API can be called even if there is a pending JavaScript exception. | |
-### napi_make_callback | |
+### napi\_make\_callback | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -5278,12 +5443,12 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env, | |
* `[in] env`: The environment that the API is invoked under. | |
* `[in] async_context`: Context for the async operation that is | |
- invoking the callback. This should normally be a value previously | |
- obtained from [`napi_async_init`][]. | |
- In order to retain ABI compatibility with previous versions, passing `NULL` | |
- for `async_context` does not result in an error. However, this results | |
- in incorrect operation of async hooks. Potential issues include loss of | |
- async context when using the `AsyncLocalStorage` API. | |
+ invoking the callback. This should normally be a value previously | |
+ obtained from [`napi_async_init`][]. | |
+ In order to retain ABI compatibility with previous versions, passing `NULL` | |
+ for `async_context` does not result in an error. However, this results | |
+ in incorrect operation of async hooks. Potential issues include loss of | |
+ async context when using the `AsyncLocalStorage` API. | |
* `[in] recv`: The `this` value passed to the called function. | |
* `[in] func`: `napi_value` representing the JavaScript function to be invoked. | |
* `[in] argc`: The count of elements in the `argv` array. | |
@@ -5295,11 +5460,11 @@ Returns `napi_ok` if the API succeeded. | |
This method allows a JavaScript function object to be called from a native | |
add-on. This API is similar to `napi_call_function`. However, it is used to call | |
-*from* native code back *into* JavaScript *after* returning from an async | |
+_from_ native code back _into_ JavaScript _after_ returning from an async | |
operation (when there is no other script on the stack). It is a fairly simple | |
wrapper around `node::MakeCallback`. | |
-Note it is *not* necessary to use `napi_make_callback` from within a | |
+Note it is _not_ necessary to use `napi_make_callback` from within a | |
`napi_async_complete_callback`; in that situation the callback's async | |
context has already been set up, so a direct call to `napi_call_function` | |
is sufficient and appropriate. Use of the `napi_make_callback` function | |
@@ -5309,7 +5474,8 @@ may be required when implementing custom async behavior that does not use | |
Any `process.nextTick`s or Promises scheduled on the microtask queue by | |
JavaScript during the callback are ran before returning back to C/C++. | |
-### napi_open_callback_scope | |
+### napi\_open\_callback\_scope | |
+ | |
<!-- YAML | |
added: v9.6.0 | |
napiVersion: 3 | |
@@ -5338,7 +5504,8 @@ the stack the [`napi_open_callback_scope`][] and | |
[`napi_close_callback_scope`][] functions can be used to open/close | |
the required scope. | |
-### napi_close_callback_scope | |
+### napi\_close\_callback\_scope | |
+ | |
<!-- YAML | |
added: v9.6.0 | |
napiVersion: 3 | |
@@ -5356,7 +5523,8 @@ This API can be called even if there is a pending JavaScript exception. | |
## Version management | |
-### napi_get_node_version | |
+### napi\_get\_node\_version | |
+ | |
<!-- YAML | |
added: v8.4.0 | |
napiVersion: 1 | |
@@ -5385,7 +5553,8 @@ value of [`process.release.name`][`process.release`]. | |
The returned buffer is statically allocated and does not need to be freed. | |
-### napi_get_version | |
+### napi\_get\_version | |
+ | |
<!-- YAML | |
added: v8.0.0 | |
napiVersion: 1 | |
@@ -5417,7 +5586,8 @@ support it: | |
## Memory management | |
-### napi_adjust_external_memory | |
+### napi\_adjust\_external\_memory | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -5498,7 +5668,8 @@ if (status != napi_ok) return NULL; | |
deferred = NULL; | |
``` | |
-### napi_create_promise | |
+### napi\_create\_promise | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -5520,7 +5691,8 @@ Returns `napi_ok` if the API succeeded. | |
This API creates a deferred object and a JavaScript promise. | |
-### napi_resolve_deferred | |
+### napi\_resolve\_deferred | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -5545,7 +5717,8 @@ have been retained in order to be passed to this API. | |
The deferred object is freed upon successful completion. | |
-### napi_reject_deferred | |
+### napi\_reject\_deferred | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -5570,7 +5743,8 @@ have been retained in order to be passed to this API. | |
The deferred object is freed upon successful completion. | |
-### napi_is_promise | |
+### napi\_is\_promise | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -5592,7 +5766,8 @@ napi_status napi_is_promise(napi_env env, | |
Node-API provides an API for executing a string containing JavaScript using the | |
underlying JavaScript engine. | |
-### napi_run_script | |
+### napi\_run\_script | |
+ | |
<!-- YAML | |
added: v8.5.0 | |
napiVersion: 1 | |
@@ -5626,7 +5801,8 @@ the following caveats: | |
Node-API provides a function for getting the current event loop associated with | |
a specific `napi_env`. | |
-### napi_get_uv_event_loop | |
+### napi\_get\_uv\_event\_loop | |
+ | |
<!-- YAML | |
added: | |
- v9.3.0 | |
@@ -5766,7 +5942,7 @@ Neither does `napi_unref_threadsafe_function` mark the thread-safe functions as | |
able to be destroyed nor does `napi_ref_threadsafe_function` prevent it from | |
being destroyed. | |
-### napi_create_threadsafe_function | |
+### napi\_create\_threadsafe\_function | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5818,7 +5994,7 @@ napi_create_threadsafe_function(napi_env env, | |
[`napi_threadsafe_function_call_js`][] provides more details. | |
* `[out] result`: The asynchronous thread-safe JavaScript function. | |
-### napi_get_threadsafe_function_context | |
+### napi\_get\_threadsafe\_function\_context | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5836,7 +6012,7 @@ napi_get_threadsafe_function_context(napi_threadsafe_function func, | |
This API may be called from any thread which makes use of `func`. | |
-### napi_call_threadsafe_function | |
+### napi\_call\_threadsafe\_function | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5877,7 +6053,7 @@ added to the queue if the API returns `napi_ok`. | |
This API may be called from any thread which makes use of `func`. | |
-### napi_acquire_threadsafe_function | |
+### napi\_acquire\_threadsafe\_function | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5899,7 +6075,7 @@ it. | |
This API may be called from any thread which will start making use of `func`. | |
-### napi_release_threadsafe_function | |
+### napi\_release\_threadsafe\_function | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5928,7 +6104,7 @@ to any thread-safe APIs after having called this API has undefined results, as | |
This API may be called from any thread which will stop making use of `func`. | |
-### napi_ref_threadsafe_function | |
+### napi\_ref\_threadsafe\_function | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5954,7 +6130,7 @@ being destroyed. `napi_acquire_threadsafe_function` and | |
This API may only be called from the main thread. | |
-### napi_unref_threadsafe_function | |
+### napi\_unref\_threadsafe\_function | |
<!-- YAML | |
added: v10.6.0 | |
@@ -5977,7 +6153,7 @@ This API may only be called from the main thread. | |
## Miscellaneous utilities | |
-## node_api_get_module_file_name | |
+## node\_api\_get\_module\_file\_name | |
<!-- YAML | |
added: | |
diff --git a/doc/api/net.md b/doc/api/net.md | |
index 6d5487b674..8ba456c10f 100644 | |
--- a/doc/api/net.md | |
+++ b/doc/api/net.md | |
@@ -40,11 +40,11 @@ applies when a Node.js API creates a Unix domain socket but the program then | |
crashes. In short, a Unix domain socket will be visible in the filesystem and | |
will persist until unlinked. | |
-On Windows, the local domain is implemented using a named pipe. The path *must* | |
+On Windows, the local domain is implemented using a named pipe. The path _must_ | |
refer to an entry in `\\?\pipe\` or `\\.\pipe\`. Any characters are permitted, | |
but the latter may do some processing of pipe names, such as resolving `..` | |
sequences. Despite how it might look, the pipe namespace is flat. Pipes will | |
-*not persist*. They are removed when the last reference to them is closed. | |
+_not persist_. They are removed when the last reference to them is closed. | |
Unlike Unix domain sockets, Windows will close and remove the pipe when the | |
owning process exits. | |
@@ -145,7 +151,7 @@ added: | |
- v14.18.0 | |
--> | |
-* Type: {string[]} | |
+* Type: {string\[]} | |
The list of rules added to the blocklist. | |
@@ -166,7 +175,7 @@ added: | |
* `address` {string} The network address as either an IPv4 or IPv6 string. | |
**Default**: `'127.0.0.1'` if `family` is `'ipv4'`; `'::'` if `family` is | |
`'ipv6'`. | |
- * `family` {string} One of either `'ipv4'` or 'ipv6'`. **Default**: `'ipv4'`. | |
+ * `family` {string} One of either `'ipv4'` or 'ipv6'`. **Default**: `'ipv4'\`. | |
* `flowlabel` {number} An IPv6 flow-label used only if `family` is `'ipv6'`. | |
* `port` {number} An IP port. | |
@@ -424,9 +449,8 @@ changes: | |
* Returns: {net.Server} | |
<!--lint disable no-undefined-references--> | |
-If `port` is specified, it behaves the same as | |
-<a href="#serverlistenport-host-backlog-callback"> | |
-<code>server.listen([port[, host[, backlog]]][, callback])</code></a>. | |
+ | |
+If `port` is specified, it behaves the same as <a href="#serverlistenport-host-backlog-callback"> <code>server.listen(\[port\[, host\[, backlog]]]\[, callback])</code></a>. | |
Otherwise, if `path` is specified, it behaves the same as | |
[`server.listen(path[, backlog][, callback])`][`server.listen(path)`]. | |
If none of them is specified, an error will be thrown. | |
@@ -530,7 +560,7 @@ added: v0.9.1 | |
* Returns: {net.Server} | |
Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will | |
-*not* let the program exit if it's the only server left (the default behavior). | |
+_not_ let the program exit if it's the only server left (the default behavior). | |
If the server is `ref`ed calling `ref()` again will have no effect. | |
### `server.unref()` | |
@@ -980,7 +1035,7 @@ added: v0.9.1 | |
* Returns: {net.Socket} The socket itself. | |
Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will | |
-*not* let the program exit if it's the only socket left (the default behavior). | |
+_not_ let the program exit if it's the only socket left (the default behavior). | |
If the socket is `ref`ed calling `ref` again will have no effect. | |
### `socket.remoteAddress` | |
@@ -1313,7 +1386,7 @@ added: v0.1.90 | |
[`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`]. | |
* `host` {string} Host the socket should connect to. Will be passed to | |
[`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`]. | |
- **Default:** `'localhost'`. | |
+ **Default:** `'localhost'`. | |
* `connectListener` {Function} Common parameter of the | |
[`net.createConnection()`][] functions, an "once" listener for the | |
`'connect'` event on the initiating socket. Will be passed to | |
diff --git a/doc/api/os.md b/doc/api/os.md | |
index 990d4cce9e..ca941bb861 100644 | |
--- a/doc/api/os.md | |
+++ b/doc/api/os.md | |
@@ -54,7 +58,7 @@ process signals, and so on. The specific constants defined are described in | |
added: v0.3.3 | |
--> | |
-* Returns: {Object[]} | |
+* Returns: {Object\[]} | |
Returns an array of objects containing information about each logical CPU core. | |
@@ -198,7 +210,7 @@ Returns the host name of the operating system as a string. | |
added: v0.3.3 | |
--> | |
-* Returns: {number[]} | |
+* Returns: {number\[]} | |
Returns an array containing the 1, 5, and 15 minute load averages. | |
diff --git a/doc/api/packages.md b/doc/api/packages.md | |
index a04e18421b..94b4a1e105 100644 | |
--- a/doc/api/packages.md | |
+++ b/doc/api/packages.md | |
@@ -483,25 +489,25 @@ For example, a package that wants to provide different ES module exports for | |
Node.js implements the following conditions: | |
* `"import"` - matches when the package is loaded via `import` or | |
- `import()`, or via any top-level import or resolve operation by the | |
- ECMAScript module loader. Applies regardless of the module format of the | |
- target file. _Always mutually exclusive with `"require"`._ | |
+ `import()`, or via any top-level import or resolve operation by the | |
+ ECMAScript module loader. Applies regardless of the module format of the | |
+ target file. _Always mutually exclusive with `"require"`._ | |
* `"require"` - matches when the package is loaded via `require()`. The | |
- referenced file should be loadable with `require()` although the condition | |
- matches regardless of the module format of the target file. Expected | |
- formats include CommonJS, JSON, and native addons but not ES modules as | |
- `require()` doesn't support them. _Always mutually exclusive with | |
- `"import"`._ | |
+ referenced file should be loadable with `require()` although the condition | |
+ matches regardless of the module format of the target file. Expected | |
+ formats include CommonJS, JSON, and native addons but not ES modules as | |
+ `require()` doesn't support them. _Always mutually exclusive with | |
+ `"import"`._ | |
* `"node"` - matches for any Node.js environment. Can be a CommonJS or ES | |
- module file. _This condition should always come after `"import"` or | |
- `"require"`._ | |
+ module file. _This condition should always come after `"import"` or | |
+ `"require"`._ | |
* `"node-addons"` - similar to `"node"` and matches for any Node.js environment. | |
- This condition can be used to provide an entry point which uses native C++ | |
- addons as opposed to an entry point which is more universal and doesn't rely | |
- on native addons. This condition can be disabled via the | |
- [`--no-addons` flag][]. | |
+ This condition can be used to provide an entry point which uses native C++ | |
+ addons as opposed to an entry point which is more universal and doesn't rely | |
+ on native addons. This condition can be disabled via the | |
+ [`--no-addons` flag][]. | |
* `"default"` - the generic fallback that always matches. Can be a CommonJS | |
- or ES module file. _This condition should always come last._ | |
+ or ES module file. _This condition should always come last._ | |
Within the [`"exports"`][] object, key order is significant. During condition | |
matching, earlier entries have higher priority and take precedence over later | |
@@ -603,12 +610,12 @@ These user conditions can be enabled in Node.js via the [`--conditions` flag][]. | |
The following condition definitions are currently endorsed by Node.js: | |
* `"browser"` - any environment which implements a standard subset of global | |
- browser APIs available from JavaScript in web browsers, including the DOM | |
- APIs. | |
+ browser APIs available from JavaScript in web browsers, including the DOM | |
+ APIs. | |
* `"development"` - can be used to define a development-only environment | |
- entry point. _Must always be mutually exclusive with `"production"`._ | |
+ entry point. _Must always be mutually exclusive with `"production"`._ | |
* `"production"` - can be used to define a production environment entry | |
- point. _Must always be mutually exclusive with `"development"`._ | |
+ point. _Must always be mutually exclusive with `"development"`._ | |
The above user conditions can be enabled in Node.js via the | |
[`--conditions` flag][]. | |
@@ -779,16 +787,16 @@ Every pattern has tradeoffs, but there are two broad approaches that satisfy the | |
following conditions: | |
1. The package is usable via both `require` and `import`. | |
-1. The package is usable in both current Node.js and older versions of Node.js | |
+2. The package is usable in both current Node.js and older versions of Node.js | |
that lack support for ES modules. | |
-1. The package main entry point, e.g. `'pkg'` can be used by both `require` to | |
+3. The package main entry point, e.g. `'pkg'` can be used by both `require` to | |
resolve to a CommonJS file and by `import` to resolve to an ES module file. | |
(And likewise for exported paths, e.g. `'pkg/feature'`.) | |
-1. The package provides named exports, e.g. `import { name } from 'pkg'` rather | |
+4. The package provides named exports, e.g. `import { name } from 'pkg'` rather | |
than `import pkg from 'pkg'; pkg.name`. | |
-1. The package is potentially usable in other ES module environments such as | |
+5. The package is potentially usable in other ES module environments such as | |
browsers. | |
-1. The hazards described in the previous section are avoided or minimized. | |
+6. The hazards described in the previous section are avoided or minimized. | |
#### Approach #1: Use an ES module wrapper | |
@@ -914,33 +923,33 @@ CommonJS and ES module instances of the package: | |
`Date`, for example, needs to be instantiated to contain state; if it were a | |
package, it would be used like this: | |
- ```js | |
- import Date from 'date'; | |
- const someDate = new Date(); | |
- // someDate contains state; Date does not | |
- ``` | |
+ ```js | |
+ import Date from 'date'; | |
+ const someDate = new Date(); | |
+ // someDate contains state; Date does not | |
+ ``` | |
The `new` keyword isn’t required; a package’s function can return a new | |
object, or modify a passed-in object, to keep the state external to the | |
package. | |
-1. Isolate the state in one or more CommonJS files that are shared between the | |
+2. Isolate the state in one or more CommonJS files that are shared between the | |
CommonJS and ES module versions of the package. For example, if the CommonJS | |
and ES module entry points are `index.cjs` and `index.mjs`, respectively: | |
- ```cjs | |
- // ./node_modules/pkg/index.cjs | |
- const state = require('./state.cjs'); | |
- module.exports.state = state; | |
- ``` | |
+ ```cjs | |
+ // ./node_modules/pkg/index.cjs | |
+ const state = require('./state.cjs'); | |
+ module.exports.state = state; | |
+ ``` | |
- ```js | |
- // ./node_modules/pkg/index.mjs | |
- import state from './state.cjs'; | |
- export { | |
- state | |
- }; | |
- ``` | |
+ ```js | |
+ // ./node_modules/pkg/index.mjs | |
+ import state from './state.cjs'; | |
+ export { | |
+ state | |
+ }; | |
+ ``` | |
Even if `pkg` is used via both `require` and `import` in an application (for | |
example, via `import` in application code and via `require` by a dependency) | |
@@ -1097,7 +1111,7 @@ Files ending with `.js` are loaded as ES modules when the nearest parent | |
The nearest parent `package.json` is defined as the first `package.json` found | |
when searching in the current folder, that folder’s parent, and so on up | |
-until a node_modules folder or the volume root is reached. | |
+until a node\_modules folder or the volume root is reached. | |
```json | |
// package.json | |
@@ -1153,7 +1168,7 @@ changes: | |
description: Implement conditional exports. | |
--> | |
-* Type: {Object} | {string} | {string[]} | |
+* Type: {Object} | {string} | {string\[]} | |
```json | |
{ | |
diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md | |
index 553cf3dc79..34d2a58bd0 100644 | |
--- a/doc/api/perf_hooks.md | |
+++ b/doc/api/perf_hooks.md | |
@@ -61,9 +64,9 @@ added: | |
--> | |
* `utilization1` {Object} The result of a previous call to | |
- `eventLoopUtilization()`. | |
+ `eventLoopUtilization()`. | |
* `utilization2` {Object} The result of a previous call to | |
- `eventLoopUtilization()` prior to `utilization1`. | |
+ `eventLoopUtilization()` prior to `utilization1`. | |
* Returns {Object} | |
* `idle` {number} | |
* `active` {number} | |
@@ -167,12 +172,12 @@ Creates a new `PerformanceMeasure` entry in the Performance Timeline. A | |
`performanceEntry.duration` measures the number of milliseconds elapsed since | |
`startMark` and `endMark`. | |
-The `startMark` argument may identify any *existing* `PerformanceMark` in the | |
-Performance Timeline, or *may* identify any of the timestamp properties | |
+The `startMark` argument may identify any _existing_ `PerformanceMark` in the | |
+Performance Timeline, or _may_ identify any of the timestamp properties | |
provided by the `PerformanceNodeTiming` class. If the named `startMark` does | |
not exist, an error is thrown. | |
-The optional `endMark` argument must identify any *existing* `PerformanceMark` | |
+The optional `endMark` argument must identify any _existing_ `PerformanceMark` | |
in the Performance Timeline or any of the timestamp properties provided by the | |
`PerformanceNodeTiming` class. `endMark` will be `performance.now()` | |
if no parameter is passed, otherwise if the named `endMark` does not exist, an | |
@@ -598,7 +628,7 @@ changes: | |
* `options` {Object} | |
* `type` {string} A single {PerformanceEntry} type. Must not be given | |
if `entryTypes` is already specified. | |
- * `entryTypes` {string[]} An array of strings identifying the types of | |
+ * `entryTypes` {string\[]} An array of strings identifying the types of | |
{PerformanceEntry} instances the observer is interested in. If not | |
provided an error will be thrown. | |
* `buffered` {boolean} If true, the observer callback is called with a | |
@@ -639,7 +671,7 @@ The constructor of this class is not exposed to users. | |
added: v8.5.0 | |
--> | |
-* Returns: {PerformanceEntry[]} | |
+* Returns: {PerformanceEntry\[]} | |
Returns a list of `PerformanceEntry` objects in chronological order | |
with respect to `performanceEntry.startTime`. | |
@@ -683,7 +716,7 @@ added: v8.5.0 | |
* `name` {string} | |
* `type` {string} | |
-* Returns: {PerformanceEntry[]} | |
+* Returns: {PerformanceEntry\[]} | |
Returns a list of `PerformanceEntry` objects in chronological order | |
with respect to `performanceEntry.startTime` whose `performanceEntry.name` is | |
@@ -736,7 +770,7 @@ added: v8.5.0 | |
--> | |
* `type` {string} | |
-* Returns: {PerformanceEntry[]} | |
+* Returns: {PerformanceEntry\[]} | |
Returns a list of `PerformanceEntry` objects in chronological order | |
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` | |
diff --git a/doc/api/process.md b/doc/api/process.md | |
index 91b23a3f31..468d07e781 100644 | |
--- a/doc/api/process.md | |
+++ b/doc/api/process.md | |
@@ -36,10 +37,10 @@ continue. | |
The listener callback function is invoked with the value of | |
[`process.exitCode`][] passed as the only argument. | |
-The `'beforeExit'` event is *not* emitted for conditions causing explicit | |
+The `'beforeExit'` event is _not_ emitted for conditions causing explicit | |
termination, such as calling [`process.exit()`][] or uncaught exceptions. | |
-The `'beforeExit'` should *not* be used as an alternative to the `'exit'` event | |
+The `'beforeExit'` should _not_ be used as an alternative to the `'exit'` event | |
unless the intention is to schedule additional work. | |
```mjs | |
@@ -389,7 +396,7 @@ default behavior to exit the process by installing a | |
#### Warning: Using `'uncaughtException'` correctly | |
`'uncaughtException'` is a crude mechanism for exception handling | |
-intended to be used only as a last resort. The event *should not* be used as | |
+intended to be used only as a last resort. The event _should not_ be used as | |
an equivalent to `On Error Resume Next`. Unhandled exceptions inherently mean | |
that an application is in an undefined state. Attempting to resume application | |
code without properly recovering from the exception can cause additional | |
@@ -678,7 +689,7 @@ refer to signal(7) for a listing of standard POSIX signal names such as | |
Signals are not available on [`Worker`][] threads. | |
The signal handler will receive the signal's name (`'SIGINT'`, | |
- `'SIGTERM'`, etc.) as the first argument. | |
+`'SIGTERM'`, etc.) as the first argument. | |
The name of each event will be the uppercase common name for the signal (e.g. | |
`'SIGINT'` for `SIGINT` signals). | |
@@ -737,8 +748,7 @@ process.on('SIGTERM', handle); | |
* `'SIGTERM'` is not supported on Windows, it can be listened on. | |
* `'SIGINT'` from the terminal is supported on all platforms, and can usually be | |
generated with <kbd>Ctrl</kbd>+<kbd>C</kbd> (though this may be configurable). | |
- It is not generated when [terminal raw mode][] is enabled and | |
- <kbd>Ctrl</kbd>+<kbd>C</kbd> is used. | |
+ It is not generated when [terminal raw mode][] is enabled and <kbd>Ctrl</kbd>+<kbd>C</kbd> is used. | |
* `'SIGBREAK'` is delivered on Windows when <kbd>Ctrl</kbd>+<kbd>Break</kbd> is | |
pressed. On non-Windows platforms, it can be listened on, but there is no way | |
to send or generate it. | |
@@ -749,11 +759,11 @@ process.on('SIGTERM', handle); | |
terminate Node.js on all platforms. | |
* `'SIGSTOP'` cannot have a listener installed. | |
* `'SIGBUS'`, `'SIGFPE'`, `'SIGSEGV'` and `'SIGILL'`, when not raised | |
- artificially using kill(2), inherently leave the process in a state from | |
- which it is not safe to call JS listeners. Doing so might cause the process | |
- to stop responding. | |
+ artificially using kill(2), inherently leave the process in a state from | |
+ which it is not safe to call JS listeners. Doing so might cause the process | |
+ to stop responding. | |
* `0` can be sent to test for the existence of a process, it has no effect if | |
- the process exists, but will throw an error if the process does not exist. | |
+ the process exists, but will throw an error if the process does not exist. | |
Windows does not support signals so has no equivalent to termination by signal, | |
but Node.js offers some emulation with [`process.kill()`][], and | |
@@ -793,16 +806,16 @@ return `true` in the following cases: | |
* Flags may omit leading single (`-`) or double (`--`) dashes; e.g., | |
`inspect-brk` for `--inspect-brk`, or `r` for `-r`. | |
* Flags passed through to V8 (as listed in `--v8-options`) may replace | |
- one or more *non-leading* dashes for an underscore, or vice-versa; | |
+ one or more _non-leading_ dashes for an underscore, or vice-versa; | |
e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, | |
etc. | |
* Flags may contain one or more equals (`=`) characters; all | |
characters after and including the first equals will be ignored; | |
e.g., `--stack-trace-limit=100`. | |
-* Flags *must* be allowable within [`NODE_OPTIONS`][]. | |
+* Flags _must_ be allowable within [`NODE_OPTIONS`][]. | |
When iterating over `process.allowedNodeEnvironmentFlags`, flags will | |
-appear only *once*; each will begin with one or more dashes. Flags | |
+appear only _once_; each will begin with one or more dashes. Flags | |
passed through to V8 will contain underscores instead of non-leading | |
dashes: | |
@@ -832,11 +845,12 @@ The methods `add()`, `clear()`, and `delete()` of | |
`process.allowedNodeEnvironmentFlags` do nothing, and will fail | |
silently. | |
-If Node.js was compiled *without* [`NODE_OPTIONS`][] support (shown in | |
+If Node.js was compiled _without_ [`NODE_OPTIONS`][] support (shown in | |
[`process.config`][]), `process.allowedNodeEnvironmentFlags` will | |
-contain what *would have* been allowable. | |
+contain what _would have_ been allowable. | |
## `process.arch` | |
+ | |
<!-- YAML | |
added: v0.5.0 | |
--> | |
@@ -864,7 +879,7 @@ console.log(`This processor architecture is ${process.arch}`); | |
added: v0.1.27 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The `process.argv` property returns an array containing the command-line | |
arguments passed when the Node.js process was launched. The first element will | |
@@ -1241,7 +1270,7 @@ added: v8.0.0 | |
* `warning` {string|Error} The warning to emit. | |
* `options` {Object} | |
* `type` {string} When `warning` is a `String`, `type` is the name to use | |
- for the *type* of warning being emitted. **Default:** `'Warning'`. | |
+ for the _type_ of warning being emitted. **Default:** `'Warning'`. | |
* `code` {string} A unique identifier for the warning instance being emitted. | |
* `ctor` {Function} When `warning` is a `String`, `ctor` is an optional | |
function used to limit the generated stack trace. **Default:** | |
@@ -1315,7 +1345,7 @@ added: v6.0.0 | |
* `warning` {string|Error} The warning to emit. | |
* `type` {string} When `warning` is a `String`, `type` is the name to use | |
- for the *type* of warning being emitted. **Default:** `'Warning'`. | |
+ for the _type_ of warning being emitted. **Default:** `'Warning'`. | |
* `code` {string} A unique identifier for the warning instance being emitted. | |
* `ctor` {Function} When `warning` is a `String`, `ctor` is an optional | |
function used to limit the generated stack trace. **Default:** | |
@@ -1617,7 +1650,7 @@ are visible to the operating system or to native add-ons. | |
added: v0.7.7 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
The `process.execArgv` property returns the set of Node.js-specific command-line | |
options passed when the Node.js process was launched. These options do not | |
@@ -1697,11 +1735,11 @@ completed fully, including I/O operations to `process.stdout` and | |
`process.stderr`. | |
In most situations, it is not actually necessary to call `process.exit()` | |
-explicitly. The Node.js process will exit on its own *if there is no additional | |
-work pending* in the event loop. The `process.exitCode` property can be set to | |
+explicitly. The Node.js process will exit on its own _if there is no additional | |
+work pending_ in the event loop. The `process.exitCode` property can be set to | |
tell the process which exit code to use when the process exits gracefully. | |
-For instance, the following example illustrates a *misuse* of the | |
+For instance, the following example illustrates a _misuse_ of the | |
`process.exit()` method that could lead to data printed to stdout being | |
truncated and lost: | |
@@ -1726,11 +1764,11 @@ if (someConditionNotMet()) { | |
``` | |
The reason this is problematic is because writes to `process.stdout` in Node.js | |
-are sometimes *asynchronous* and may occur over multiple ticks of the Node.js | |
+are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js | |
event loop. Calling `process.exit()`, however, forces the process to exit | |
-*before* those additional writes to `stdout` can be performed. | |
+_before_ those additional writes to `stdout` can be performed. | |
-Rather than calling `process.exit()` directly, the code *should* set the | |
+Rather than calling `process.exit()` directly, the code _should_ set the | |
`process.exitCode` and allow the process to exit naturally by avoiding | |
scheduling any additional work for the event loop: | |
@@ -1757,7 +1795,7 @@ if (someConditionNotMet()) { | |
``` | |
If it is necessary to terminate the Node.js process due to an error condition, | |
-throwing an *uncaught* error and allowing the process to terminate accordingly | |
+throwing an _uncaught_ error and allowing the process to terminate accordingly | |
is safer than calling `process.exit()`. | |
In [`Worker`][] threads, this function stops the current thread rather | |
@@ -1867,7 +1910,7 @@ Android). | |
added: v0.9.4 | |
--> | |
-* Returns: {integer[]} | |
+* Returns: {integer\[]} | |
The `process.getgroups()` method returns an array with the supplementary group | |
IDs. POSIX leaves it unspecified if the effective group ID is included but | |
@@ -1938,8 +1984,8 @@ added: v0.7.6 | |
> Stability: 3 - Legacy. Use [`process.hrtime.bigint()`][] instead. | |
-* `time` {integer[]} The result of a previous call to `process.hrtime()` | |
-* Returns: {integer[]} | |
+* `time` {integer\[]} The result of a previous call to `process.hrtime()` | |
+* Returns: {integer\[]} | |
This is the legacy version of [`process.hrtime.bigint()`][] | |
before `bigint` was introduced in JavaScript. | |
@@ -2300,7 +2353,7 @@ console.log('scheduled'); | |
``` | |
This is important when developing APIs in order to give users the opportunity | |
-to assign event handlers *after* an object has been constructed but before any | |
+to assign event handlers _after_ an object has been constructed but before any | |
I/O has occurred: | |
```mjs | |
@@ -2426,7 +2479,7 @@ nextTick(() => console.log(1)); | |
// 3 | |
``` | |
-For *most* userland use cases, the `queueMicrotask()` API provides a portable | |
+For _most_ userland use cases, the `queueMicrotask()` API provides a portable | |
and reliable mechanism for deferring execution that works across multiple | |
JavaScript platform environments and should be favored over `process.nextTick()`. | |
In simple scenarios, `queueMicrotask()` can be a drop-in replacement for | |
@@ -2602,9 +2660,10 @@ tarball. | |
that are no longer supported). | |
* `'Dubnium'` for the 10.x LTS line beginning with 10.13.0. | |
* `'Erbium'` for the 12.x LTS line beginning with 12.13.0. | |
- For other LTS Release code names, see [Node.js Changelog Archive](https://github.com/nodejs/node/blob/HEAD/doc/changelogs/CHANGELOG_ARCHIVE.md) | |
+ For other LTS Release code names, see [Node.js Changelog Archive](https://github.com/nodejs/node/blob/HEAD/doc/changelogs/CHANGELOG\_ARCHIVE.md) | |
<!-- eslint-skip --> | |
+ | |
```js | |
{ | |
name: 'node', | |
@@ -3173,7 +3249,7 @@ This feature is not available in [`Worker`][] threads. | |
added: v0.9.4 | |
--> | |
-* `groups` {integer[]} | |
+* `groups` {integer\[]} | |
The `process.setgroups()` method sets the supplementary group IDs for the | |
Node.js process. This is a privileged operation that requires the Node.js | |
@@ -3390,9 +3469,9 @@ important ways: | |
respectively. | |
2. Writes may be synchronous depending on what the stream is connected to | |
and whether the system is Windows or POSIX: | |
- * Files: *synchronous* on Windows and POSIX | |
- * TTYs (Terminals): *asynchronous* on Windows, *synchronous* on POSIX | |
- * Pipes (and sockets): *synchronous* on Windows, *asynchronous* on POSIX | |
+ * Files: _synchronous_ on Windows and POSIX | |
+ * TTYs (Terminals): _asynchronous_ on Windows, _synchronous_ on POSIX | |
+ * Pipes (and sockets): _synchronous_ on Windows, _asynchronous_ on POSIX | |
These behaviors are partly for historical reasons, as changing them would | |
create backward incompatibility, but they are also expected by some users. | |
@@ -3402,7 +3481,7 @@ Synchronous writes avoid problems such as output written with `console.log()` or | |
`process.exit()` is called before an asynchronous write completes. See | |
[`process.exit()`][] for more information. | |
-***Warning***: Synchronous writes block the event loop until the write has | |
+_**Warning**_: Synchronous writes block the event loop until the write has | |
completed. This can be near instantaneous in the case of output to a file, but | |
under high system load, pipes that are not being read at the receiving end, or | |
with slow terminals or file systems, its possible for the event loop to be | |
diff --git a/doc/api/punycode.md b/doc/api/punycode.md | |
index b7183f6d39..6aa01a8348 100644 | |
--- a/doc/api/punycode.md | |
+++ b/doc/api/punycode.md | |
@@ -131,7 +139,7 @@ punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306] | |
added: v0.7.0 | |
--> | |
-* `codePoints` {integer[]} | |
+* `codePoints` {integer\[]} | |
The `punycode.ucs2.encode()` method returns a string based on an array of | |
numeric code point values. | |
diff --git a/doc/api/querystring.md b/doc/api/querystring.md | |
index 4b7db7afc3..32e9904553 100644 | |
--- a/doc/api/querystring.md | |
+++ b/doc/api/querystring.md | |
@@ -93,7 +98,7 @@ For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: | |
The object returned by the `querystring.parse()` method _does not_ | |
prototypically inherit from the JavaScript `Object`. This means that typical | |
`Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others | |
-are not defined and *will not work*. | |
+are not defined and _will not work_. | |
By default, percent-encoded characters within the query string will be assumed | |
to use UTF-8 encoding. If an alternative character encoding is used, then an | |
@@ -125,7 +131,7 @@ The `querystring.stringify()` method produces a URL query string from a | |
given `obj` by iterating through the object's "own properties". | |
It serializes the following types of values passed in `obj`: | |
-{string|number|bigint|boolean|string[]|number[]|bigint[]|boolean[]} | |
+{string|number|bigint|boolean|string\[]|number\[]|bigint\[]|boolean\[]} | |
The numeric values must be finite. Any other input values will be coerced to | |
empty strings. | |
diff --git a/doc/api/readline.md b/doc/api/readline.md | |
index 6c782fcc2d..f4bd13ef79 100644 | |
--- a/doc/api/readline.md | |
+++ b/doc/api/readline.md | |
@@ -183,7 +191,7 @@ The `'SIGCONT'` event is emitted when a Node.js process previously moved into | |
the background using <kbd>Ctrl</kbd>+<kbd>Z</kbd> (i.e. `SIGTSTP`) is then | |
brought back to the foreground using fg(1p). | |
-If the `input` stream was paused *before* the `SIGTSTP` request, this event will | |
+If the `input` stream was paused _before_ the `SIGTSTP` request, this event will | |
not be emitted. | |
The listener function is invoked without passing any arguments. | |
@@ -202,8 +211,7 @@ The `'SIGCONT'` event is _not_ supported on Windows. | |
added: v0.3.0 | |
--> | |
-The `'SIGINT'` event is emitted whenever the `input` stream receives a | |
-<kbd>Ctrl+C</kbd> input, known typically as `SIGINT`. If there are no `'SIGINT'` | |
+The `'SIGINT'` event is emitted whenever the `input` stream receives a <kbd>Ctrl+C</kbd> input, known typically as `SIGINT`. If there are no `'SIGINT'` | |
event listeners registered when the `input` stream receives a `SIGINT`, the | |
`'pause'` event will be emitted. | |
@@ -222,8 +231,7 @@ rl.on('SIGINT', () => { | |
added: v0.7.5 | |
--> | |
-The `'SIGTSTP'` event is emitted when the `input` stream receives a | |
-<kbd>Ctrl</kbd>+<kbd>Z</kbd> input, typically known as `SIGTSTP`. If there are | |
+The `'SIGTSTP'` event is emitted when the `input` stream receives a <kbd>Ctrl</kbd>+<kbd>Z</kbd> input, typically known as `SIGTSTP`. If there are | |
no `'SIGTSTP'` event listeners registered when the `input` stream receives a | |
`SIGTSTP`, the Node.js process will be sent to the background. | |
@@ -417,9 +433,10 @@ rl.write(null, { ctrl: true, name: 'u' }); | |
``` | |
The `rl.write()` method will write the data to the `readline` `Interface`'s | |
-`input` *as if it were provided by the user*. | |
+`input` _as if it were provided by the user_. | |
### `rl[Symbol.asyncIterator]()` | |
+ | |
<!-- YAML | |
added: | |
- v11.4.0 | |
@@ -678,7 +708,7 @@ added: REPLACEME | |
* Returns: this | |
The `rl.moveCursor()` method adds to the internal list of pending action an | |
-action that moves the cursor *relative* to its current position in the | |
+action that moves the cursor _relative_ to its current position in the | |
associated `stream`. | |
Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` | |
was passed to the constructor. | |
@@ -700,14 +732,14 @@ added: REPLACEME | |
* `options` {Object} | |
* `input` {stream.Readable} The [Readable][] stream to listen to. This option | |
- is *required*. | |
+ is _required_. | |
* `output` {stream.Writable} The [Writable][] stream to write readline data | |
to. | |
* `completer` {Function} An optional function used for Tab autocompletion. | |
* `terminal` {boolean} `true` if the `input` and `output` streams should be | |
treated like a TTY, and have ANSI/VT100 escape codes written to it. | |
**Default:** checking `isTTY` on the `output` stream upon instantiation. | |
- * `history` {string[]} Initial list of history lines. This option makes sense | |
+ * `history` {string\[]} Initial list of history lines. This option makes sense | |
only if `terminal` is set to `true` by the user or by an internal `output` | |
check, otherwise the history caching mechanism is not initialized at all. | |
**Default:** `[]`. | |
@@ -956,14 +994,14 @@ changes: | |
* `options` {Object} | |
* `input` {stream.Readable} The [Readable][] stream to listen to. This option | |
- is *required*. | |
+ is _required_. | |
* `output` {stream.Writable} The [Writable][] stream to write readline data | |
to. | |
* `completer` {Function} An optional function used for Tab autocompletion. | |
* `terminal` {boolean} `true` if the `input` and `output` streams should be | |
treated like a TTY, and have ANSI/VT100 escape codes written to it. | |
**Default:** checking `isTTY` on the `output` stream upon instantiation. | |
- * `history` {string[]} Initial list of history lines. This option makes sense | |
+ * `history` {string\[]} Initial list of history lines. This option makes sense | |
only if `terminal` is set to `true` by the user or by an internal `output` | |
check, otherwise the history caching mechanism is not initialized at all. | |
**Default:** `[]`. | |
@@ -1094,7 +1134,7 @@ changes: | |
the `'drain'` event to be emitted before continuing to write additional data; | |
otherwise `true`. | |
-The `readline.moveCursor()` method moves the cursor *relative* to its current | |
+The `readline.moveCursor()` method moves the cursor _relative_ to its current | |
position in a given [TTY][] `stream`. | |
## `readline.emitKeypressEvents(stream[, interface])` | |
diff --git a/doc/api/repl.md b/doc/api/repl.md | |
index 409f70b2b3..4c75bdec2c 100644 | |
--- a/doc/api/repl.md | |
+++ b/doc/api/repl.md | |
@@ -45,8 +45,8 @@ The following special commands are supported by all REPL instances: | |
`> .save ./file/to/save.js` | |
* `.load`: Load a file into the current REPL session. | |
`> .load ./file/to/load.js` | |
-* `.editor`: Enter editor mode (<kbd>Ctrl</kbd>+<kbd>D</kbd> to finish, | |
- <kbd>Ctrl</kbd>+<kbd>C</kbd> to cancel). | |
+* `.editor`: Enter editor mode (<kbd>Ctrl</kbd>+<kbd>D</kbd> to | |
+ finish, <kbd>Ctrl</kbd>+<kbd>C</kbd> to cancel). | |
```console | |
> .editor | |
@@ -69,8 +69,8 @@ The following key combinations in the REPL have these special effects: | |
When pressed twice on a blank line, has the same effect as the `.exit` | |
command. | |
* <kbd>Ctrl</kbd>+<kbd>D</kbd>: Has the same effect as the `.exit` command. | |
-* <kbd>Tab</kbd>: When pressed on a blank line, displays global and local (scope) | |
- variables. When pressed while entering other input, displays relevant | |
+* <kbd>Tab</kbd>: When pressed on a blank line, displays global and local | |
+ (scope) variables. When pressed while entering other input, displays relevant | |
autocompletion options. | |
For key bindings related to the reverse-i-search, see [`reverse-i-search`][]. | |
@@ -259,15 +262,14 @@ added: | |
--> | |
The REPL supports bi-directional reverse-i-search similar to [ZSH][]. It is | |
-triggered with <kbd>Ctrl</kbd>+<kbd>R</kbd> to search backward and | |
-<kbd>Ctrl</kbd>+<kbd>S</kbd> to search | |
-forwards. | |
+triggered with <kbd>Ctrl</kbd>+<kbd>R</kbd> to search backward | |
+and <kbd>Ctrl</kbd>+<kbd>S</kbd> to search forwards. | |
Duplicated history entries will be skipped. | |
Entries are accepted as soon as any key is pressed that doesn't correspond | |
-with the reverse search. Cancelling is possible by pressing <kbd>Esc</kbd> or | |
-<kbd>Ctrl</kbd>+<kbd>C</kbd>. | |
+with the reverse search. Cancelling is possible by pressing <kbd>Esc</kbd> | |
+or <kbd>Ctrl</kbd>+<kbd>C</kbd>. | |
Changing the direction immediately searches for the next entry in the expected | |
direction from the current position on. | |
@@ -411,7 +416,7 @@ added: v0.11.0 | |
--> | |
The `'reset'` event is emitted when the REPL's context is reset. This occurs | |
-whenever the `.clear` command is received as input *unless* the REPL is using | |
+whenever the `.clear` command is received as input _unless_ the REPL is using | |
the default evaluator and the `repl.REPLServer` instance was created with the | |
`useGlobal` option set to `true`. The listener callback will be called with a | |
reference to the `context` object as the only argument. | |
@@ -455,7 +461,7 @@ Clearing context... | |
added: v0.3.0 | |
--> | |
-* `keyword` {string} The command keyword (*without* a leading `.` character). | |
+* `keyword` {string} The command keyword (_without_ a leading `.` character). | |
* `cmd` {Object|Function} The function to invoke when the command is processed. | |
The `replServer.defineCommand()` method is used to add new `.`-prefixed commands | |
@@ -562,7 +573,7 @@ with REPL instances programmatically. | |
added: v14.5.0 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
A list of the names of all Node.js modules, e.g., `'http'`. | |
@@ -611,16 +623,16 @@ changes: | |
color support on the `output` stream if the REPL instance's `terminal` value | |
is `true`. | |
* `useGlobal` {boolean} If `true`, specifies that the default evaluation | |
- function will use the JavaScript `global` as the context as opposed to | |
- creating a new separate context for the REPL instance. The node CLI REPL | |
- sets this value to `true`. **Default:** `false`. | |
+ function will use the JavaScript `global` as the context as opposed to | |
+ creating a new separate context for the REPL instance. The node CLI REPL | |
+ sets this value to `true`. **Default:** `false`. | |
* `ignoreUndefined` {boolean} If `true`, specifies that the default writer | |
- will not output the return value of a command if it evaluates to | |
- `undefined`. **Default:** `false`. | |
+ will not output the return value of a command if it evaluates to | |
+ `undefined`. **Default:** `false`. | |
* `writer` {Function} The function to invoke to format the output of each | |
- command before writing to `output`. **Default:** [`util.inspect()`][]. | |
+ command before writing to `output`. **Default:** [`util.inspect()`][]. | |
* `completer` {Function} An optional function used for custom Tab auto | |
- completion. See [`readline.InterfaceCompleter`][] for an example. | |
+ completion. See [`readline.InterfaceCompleter`][] for an example. | |
* `replMode` {symbol} A flag that specifies whether the default evaluator | |
executes all JavaScript commands in strict mode or default (sloppy) mode. | |
Acceptable values are: | |
diff --git a/doc/api/stream.md b/doc/api/stream.md | |
index 7042cbb118..9371a20a5c 100644 | |
--- a/doc/api/stream.md | |
+++ b/doc/api/stream.md | |
@@ -110,12 +111,12 @@ enforce a strict memory limitation in general. Specific stream implementations | |
may choose to enforce stricter limits but doing so is optional. | |
Because [`Duplex`][] and [`Transform`][] streams are both `Readable` and | |
-`Writable`, each maintains *two* separate internal buffers used for reading and | |
+`Writable`, each maintains _two_ separate internal buffers used for reading and | |
writing, allowing each side to operate independently of the other while | |
maintaining an appropriate and efficient flow of data. For example, | |
[`net.Socket`][] instances are [`Duplex`][] streams whose `Readable` side allows | |
-consumption of data received *from* the socket and whose `Writable` side allows | |
-writing data *to* the socket. Because data may be written to the socket at a | |
+consumption of data received _from_ the socket and whose `Writable` side allows | |
+writing data _to_ the socket. Because data may be written to the socket at a | |
faster or slower rate than data is received, each side should | |
operate (and buffer) independently of the other. | |
@@ -196,7 +197,7 @@ section [API for stream implementers][]. | |
### Writable streams | |
-Writable streams are an abstraction for a *destination* to which data is | |
+Writable streams are an abstraction for a _destination_ to which data is | |
written. | |
Examples of [`Writable`][] streams include: | |
@@ -302,7 +307,7 @@ The stream is closed when the `'error'` event is emitted unless the | |
[`autoDestroy`][writable-new] option was set to `false` when creating the | |
stream. | |
-After `'error'`, no further events other than `'close'` *should* be emitted | |
+After `'error'`, no further events other than `'close'` _should_ be emitted | |
(including `'error'` events). | |
##### Event: `'finish'` | |
@@ -720,7 +743,7 @@ A `Writable` stream in object mode will always ignore the `encoding` argument. | |
### Readable streams | |
-Readable streams are an abstraction for a *source* from which data is | |
+Readable streams are an abstraction for a _source_ from which data is | |
consumed. | |
Examples of `Readable` streams include: | |
@@ -768,13 +791,13 @@ The `Readable` can switch back to paused mode using one of the following: | |
The important concept to remember is that a `Readable` will not generate data | |
until a mechanism for either consuming or ignoring that data is provided. If | |
-the consuming mechanism is disabled or taken away, the `Readable` will *attempt* | |
+the consuming mechanism is disabled or taken away, the `Readable` will _attempt_ | |
to stop generating the data. | |
For backward compatibility reasons, removing [`'data'`][] event handlers will | |
**not** automatically pause the stream. Also, if there are piped destinations, | |
then calling [`stream.pause()`][stream-pause] will not guarantee that the | |
-stream will *remain* paused once those destinations drain and ask for more data. | |
+stream will _remain_ paused once those destinations drain and ask for more data. | |
If a [`Readable`][] is switched into flowing mode and there are no consumers | |
available to handle the data, that data will be lost. This can occur, for | |
@@ -810,7 +833,7 @@ emitting events as data is generated. | |
Calling `readable.pause()`, `readable.unpipe()`, or receiving backpressure | |
will cause the `readable.readableFlowing` to be set as `false`, | |
-temporarily halting the flowing of events but *not* halting the generation of | |
+temporarily halting the flowing of events but _not_ halting the generation of | |
data. While in this state, attaching a listener for the `'data'` event | |
will not switch `readable.readableFlowing` to `true`. | |
@@ -835,7 +858,7 @@ within the stream's internal buffer. | |
The `Readable` stream API evolved across multiple Node.js versions and provides | |
multiple methods of consuming stream data. In general, developers should choose | |
-*one* of the methods of consuming data and *should never* use multiple methods | |
+_one_ of the methods of consuming data and _should never_ use multiple methods | |
to consume data from a single stream. Specifically, using a combination | |
of `on('data')`, `on('readable')`, `pipe()`, or async iterators could | |
lead to unintuitive behavior. | |
@@ -1114,7 +1150,7 @@ added: v0.9.4 | |
* `destination` {stream.Writable} The destination for writing data | |
* `options` {Object} Pipe options | |
* `end` {boolean} End the writer when the reader ends. **Default:** `true`. | |
-* Returns: {stream.Writable} The *destination*, allowing for a chain of pipes if | |
+* Returns: {stream.Writable} The _destination_, allowing for a chain of pipes if | |
it is a [`Duplex`][] or a [`Transform`][] stream | |
The `readable.pipe()` method attaches a [`Writable`][] stream to the `readable`, | |
@@ -1137,7 +1173,7 @@ readable.pipe(writable); | |
It is possible to attach multiple `Writable` streams to a single `Readable` | |
stream. | |
-The `readable.pipe()` method returns a reference to the *destination* stream | |
+The `readable.pipe()` method returns a reference to the _destination_ stream | |
making it possible to set up chains of piped streams: | |
```js | |
@@ -1161,8 +1197,8 @@ reader.on('end', () => { | |
``` | |
One important caveat is that if the `Readable` stream emits an error during | |
-processing, the `Writable` destination *is not closed* automatically. If an | |
-error occurs, it will be necessary to *manually* close each stream in order | |
+processing, the `Writable` destination _is not closed_ automatically. If an | |
+error occurs, it will be necessary to _manually_ close each stream in order | |
to prevent memory leaks. | |
The [`process.stderr`][] and [`process.stdout`][] `Writable` streams are never | |
@@ -1183,7 +1220,7 @@ specified using the `readable.setEncoding()` method or the stream is operating | |
in object mode. | |
The optional `size` argument specifies a specific number of bytes to read. If | |
-`size` bytes are not available to be read, `null` will be returned *unless* | |
+`size` bytes are not available to be read, `null` will be returned _unless_ | |
the stream has ended, in which case all of the data remaining in the internal | |
buffer will be returned. | |
@@ -1415,7 +1464,7 @@ added: v0.9.4 | |
The `readable.unpipe()` method detaches a `Writable` stream previously attached | |
using the [`stream.pipe()`][] method. | |
-If the `destination` is not specified, then *all* pipes are detached. | |
+If the `destination` is not specified, then _all_ pipes are detached. | |
If the `destination` is specified, but no pipe is set up for it, then | |
the method does nothing. | |
@@ -1740,7 +1798,7 @@ changes: | |
the stream ends even though the stream might still be writable. | |
**Default:** `true`. | |
* `signal` {AbortSignal} allows aborting the wait for the stream finish. The | |
- underlying stream will *not* be aborted if the signal is aborted. The | |
+ underlying stream will _not_ be aborted if the signal is aborted. The | |
callback will get called with an `AbortError`. All registered | |
listeners added by this function will also be removed. | |
* `callback` {Function} A callback function that takes an optional error | |
@@ -1817,7 +1877,7 @@ changes: | |
description: Add support for async generators. | |
--> | |
-* `streams` {Stream[]|Iterable[]|AsyncIterable[]|Function[]} | |
+* `streams` {Stream\[]|Iterable\[]|AsyncIterable\[]|Function\[]} | |
* `source` {Stream|Iterable|AsyncIterable|Function} | |
* Returns: {Iterable|AsyncIterable} | |
* `...transforms` {Stream|Function} | |
@@ -1961,7 +2023,7 @@ added: v16.9.0 | |
> Stability: 1 - `stream.compose` is experimental. | |
-* `streams` {Stream[]|Iterable[]|AsyncIterable[]|Function[]} | |
+* `streams` {Stream\[]|Iterable\[]|AsyncIterable\[]|Function\[]} | |
* Returns: {stream.Duplex} | |
Combines two or more streams into a `Duplex` stream that writes to the | |
@@ -2052,7 +2115,7 @@ added: | |
* `iterable` {Iterable} Object implementing the `Symbol.asyncIterator` or | |
`Symbol.iterator` iterable protocol. Emits an 'error' event if a null | |
- value is passed. | |
+ value is passed. | |
* `options` {Object} Options provided to `new stream.Readable([options])`. | |
By default, `Readable.from()` will set `options.objectMode` to `true`, unless | |
this is explicitly opted out by setting `options.objectMode` to `false`. | |
@@ -2283,14 +2358,14 @@ options are forwarded instead of implicitly forwarding all options. | |
The new stream class must then implement one or more specific methods, depending | |
on the type of stream being created, as detailed in the chart below: | |
-| Use-case | Class | Method(s) to implement | | |
-| -------- | ----- | ---------------------- | | |
-| Reading only | [`Readable`][] | [`_read()`][stream-_read] | | |
-| Writing only | [`Writable`][] | [`_write()`][stream-_write], [`_writev()`][stream-_writev], [`_final()`][stream-_final] | | |
-| Reading and writing | [`Duplex`][] | [`_read()`][stream-_read], [`_write()`][stream-_write], [`_writev()`][stream-_writev], [`_final()`][stream-_final] | | |
-| Operate on written data, then read the result | [`Transform`][] | [`_transform()`][stream-_transform], [`_flush()`][stream-_flush], [`_final()`][stream-_final] | | |
+| Use-case | Class | Method(s) to implement | | |
+| --------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------ | | |
+| Reading only | [`Readable`][] | [`_read()`][stream-_read] | | |
+| Writing only | [`Writable`][] | [`_write()`][stream-_write], [`_writev()`][stream-_writev], [`_final()`][stream-_final] | | |
+| Reading and writing | [`Duplex`][] | [`_read()`][stream-_read], [`_write()`][stream-_write], [`_writev()`][stream-_writev], [`_final()`][stream-_final] | | |
+| Operate on written data, then read the result | [`Transform`][] | [`_transform()`][stream-_transform], [`_flush()`][stream-_flush], [`_final()`][stream-_final] | | |
-The implementation code for a stream should *never* call the "public" methods | |
+The implementation code for a stream should _never_ call the "public" methods | |
of a stream that are intended for use by consumers (as described in the | |
[API for stream consumers][] section). Doing so may lead to adverse side effects | |
in application code consuming the stream. | |
@@ -2332,7 +2408,7 @@ const myWritable = new Writable({ | |
The `stream.Writable` class is extended to implement a [`Writable`][] stream. | |
-Custom `Writable` streams *must* call the `new stream.Writable([options])` | |
+Custom `Writable` streams _must_ call the `new stream.Writable([options])` | |
constructor and implement the `writable._write()` and/or `writable._writev()` | |
method. | |
@@ -2558,7 +2639,7 @@ user programs. | |
#### `writable._writev(chunks, callback)` | |
-* `chunks` {Object[]} The data to be written. The value is an array of {Object} | |
+* `chunks` {Object\[]} The data to be written. The value is an array of {Object} | |
that each represent a discrete chunk of data to write. The properties of | |
these objects are: | |
* `chunk` {Buffer|string} A buffer instance or string containing the data to | |
@@ -2700,7 +2783,7 @@ console.log(w.data); // currency: € | |
The `stream.Readable` class is extended to implement a [`Readable`][] stream. | |
-Custom `Readable` streams *must* call the `new stream.Readable([options])` | |
+Custom `Readable` streams _must_ call the `new stream.Readable([options])` | |
constructor and implement the [`readable._read()`][] method. | |
#### `new stream.Readable([options])` | |
@@ -3036,15 +3125,15 @@ A [`Duplex`][] stream is one that implements both [`Readable`][] and | |
Because JavaScript does not have support for multiple inheritance, the | |
`stream.Duplex` class is extended to implement a [`Duplex`][] stream (as opposed | |
-to extending the `stream.Readable` *and* `stream.Writable` classes). | |
+to extending the `stream.Readable` _and_ `stream.Writable` classes). | |
The `stream.Duplex` class prototypically inherits from `stream.Readable` and | |
parasitically from `stream.Writable`, but `instanceof` will work properly for | |
both base classes due to overriding [`Symbol.hasInstance`][] on | |
`stream.Writable`. | |
-Custom `Duplex` streams *must* call the `new stream.Duplex([options])` | |
-constructor and implement *both* the [`readable._read()`][] and | |
+Custom `Duplex` streams _must_ call the `new stream.Duplex([options])` | |
+constructor and implement _both_ the [`readable._read()`][] and | |
`writable._write()` methods. | |
#### `new stream.Duplex(options)` | |
@@ -3252,8 +3343,8 @@ The `stream.Transform` class is extended to implement a [`Transform`][] stream. | |
The `stream.Transform` class prototypically inherits from `stream.Duplex` and | |
implements its own versions of the `writable._write()` and | |
-[`readable._read()`][] methods. Custom `Transform` implementations *must* | |
-implement the [`transform._transform()`][stream-_transform] method and *may* | |
+[`readable._read()`][] methods. Custom `Transform` implementations _must_ | |
+implement the [`transform._transform()`][stream-_transform] method and _may_ | |
also implement the [`transform._flush()`][stream-_flush] method. | |
Care must be taken when using `Transform` streams in that data written to the | |
@@ -3336,7 +3428,7 @@ store an amount of internal state used to optimally compress the output. When | |
the stream ends, however, that additional data needs to be flushed so that the | |
compressed data will be complete. | |
-Custom [`Transform`][] implementations *may* implement the `transform._flush()` | |
+Custom [`Transform`][] implementations _may_ implement the `transform._flush()` | |
method. This will be called when there is no more written data to be consumed, | |
but before the [`'end'`][] event is emitted signaling the end of the | |
[`Readable`][] stream. | |
@@ -3519,7 +3611,7 @@ less powerful and less useful. | |
were required to store read data into buffers so the data would not be lost. | |
* The [`stream.pause()`][stream-pause] method was advisory, rather than | |
guaranteed. This meant that it was still necessary to be prepared to receive | |
- [`'data'`][] events *even when the stream was in a paused state*. | |
+ [`'data'`][] events _even when the stream was in a paused state_. | |
In Node.js 0.10, the [`Readable`][] class was added. For backward | |
compatibility with older Node.js programs, `Readable` streams switch into | |
@@ -3593,7 +3685,7 @@ situations within Node.js where this is done, particularly in the | |
Use of `readable.push('')` is not recommended. | |
Pushing a zero-byte string, `Buffer` or `Uint8Array` to a stream that is not in | |
-object mode has an interesting side effect. Because it *is* a call to | |
+object mode has an interesting side effect. Because it _is_ a call to | |
[`readable.push()`][stream-push], the call will end the reading process. | |
However, because the argument is an empty string, no data is added to the | |
readable buffer so there is nothing for a user to consume. | |
diff --git a/doc/api/string_decoder.md b/doc/api/string_decoder.md | |
index 42a288c7c8..a628a5a8a1 100644 | |
--- a/doc/api/string_decoder.md | |
+++ b/doc/api/string_decoder.md | |
@@ -88,8 +91,8 @@ changes: | |
* Returns: {string} | |
Returns a decoded string, ensuring that any incomplete multibyte characters at | |
- the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the | |
- returned string and stored in an internal buffer for the next call to | |
- `stringDecoder.write()` or `stringDecoder.end()`. | |
+the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the | |
+returned string and stored in an internal buffer for the next call to | |
+`stringDecoder.write()` or `stringDecoder.end()`. | |
[encoding]: buffer.md#buffers-and-character-encodings | |
diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md | |
index 5bfdebc32c..cbc1888e20 100644 | |
--- a/doc/api/synopsis.md | |
+++ b/doc/api/synopsis.md | |
@@ -48,7 +49,7 @@ Windows PowerShell: | |
``` | |
Next, create a new source file in the `projects` | |
- folder and call it `hello-world.js`. | |
+folder and call it `hello-world.js`. | |
Open `hello-world.js` in any preferred text editor and | |
paste in the following content: | |
diff --git a/doc/api/timers.md b/doc/api/timers.md | |
index 9105e93a9a..725b9cb189 100644 | |
--- a/doc/api/timers.md | |
+++ b/doc/api/timers.md | |
@@ -41,7 +43,7 @@ added: v9.7.0 | |
* Returns: {Immediate} a reference to `immediate` | |
-When called, requests that the Node.js event loop *not* exit so long as the | |
+When called, requests that the Node.js event loop _not_ exit so long as the | |
`Immediate` is active. Calling `immediate.ref()` multiple times will have no | |
effect. | |
@@ -99,7 +105,7 @@ added: v0.9.1 | |
* Returns: {Timeout} a reference to `timeout` | |
-When called, requests that the Node.js event loop *not* exit so long as the | |
+When called, requests that the Node.js event loop _not_ exit so long as the | |
`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. | |
By default, all `Timeout` objects are "ref'ed", making it normally unnecessary | |
@@ -411,7 +430,7 @@ added: v15.9.0 | |
Returns an async iterator that generates values in an interval of `delay` ms. | |
* `delay` {number} The number of milliseconds to wait between iterations. | |
- **Default:** `1`. | |
+ **Default:** `1`. | |
* `value` {any} A value with which the iterator returns. | |
* `options` {Object} | |
* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` | |
diff --git a/doc/api/tls.md b/doc/api/tls.md | |
index ccd1bab90e..338aadb8f1 100644 | |
--- a/doc/api/tls.md | |
+++ b/doc/api/tls.md | |
@@ -17,7 +17,7 @@ const tls = require('tls'); | |
## TLS/SSL concepts | |
The TLS/SSL is a public/private key infrastructure (PKI). For most common | |
-cases, each client and server must have a *private key*. | |
+cases, each client and server must have a _private key_. | |
Private keys can be generated in multiple ways. The example below illustrates | |
use of the OpenSSL command-line interface to generate a 2048-bit RSA private | |
@@ -27,11 +27,11 @@ key: | |
openssl genrsa -out ryans-key.pem 2048 | |
``` | |
-With TLS/SSL, all servers (and some clients) must have a *certificate*. | |
-Certificates are *public keys* that correspond to a private key, and that are | |
+With TLS/SSL, all servers (and some clients) must have a _certificate_. | |
+Certificates are _public keys_ that correspond to a private key, and that are | |
digitally signed either by a Certificate Authority or by the owner of the | |
private key (such certificates are referred to as "self-signed"). The first | |
-step to obtaining a certificate is to create a *Certificate Signing Request* | |
+step to obtaining a certificate is to create a _Certificate Signing Request_ | |
(CSR) file. | |
The OpenSSL command-line interface can be used to generate a CSR for a private | |
@@ -64,7 +64,7 @@ Where: | |
* `in`: is the signed certificate | |
* `inkey`: is the associated private key | |
* `certfile`: is a concatenation of all Certificate Authority (CA) certs into | |
- a single file, e.g. `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem` | |
+ a single file, e.g. `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem` | |
### Perfect forward secrecy | |
@@ -190,7 +190,7 @@ send it to the client. Clients and servers save the session state. When | |
reconnecting, clients send the ID of their saved session state and if the server | |
also has the state for that ID, it can agree to use it. Otherwise, the server | |
will create a new session. See [RFC 2246][] for more information, page 23 and | |
-30. | |
+30\. | |
Resumption using session identifiers is supported by most web browsers when | |
making HTTPS requests. | |
@@ -237,8 +237,8 @@ securely generate 48 bytes of secure random data and set them with the | |
regenerated and server's keys can be reset with | |
[`server.setTicketKeys()`][]. | |
-Session ticket keys are cryptographic keys, and they ***must be stored | |
-securely***. With TLS 1.2 and below, if they are compromised all sessions that | |
+Session ticket keys are cryptographic keys, and they _**must be stored | |
+securely**_. With TLS 1.2 and below, if they are compromised all sessions that | |
used tickets encrypted with them can be decrypted. They should not be stored | |
on disk, and they should be regenerated regularly. | |
@@ -329,7 +330,7 @@ The ciphers list can contain a mixture of TLSv1.3 cipher suite names, the ones | |
that start with `'TLS_'`, and specifications for TLSv1.2 and below cipher | |
suites. The TLSv1.2 ciphers support a legacy specification format, consult | |
the OpenSSL [cipher list format][] documentation for details, but those | |
-specifications do *not* apply to TLSv1.3 ciphers. The TLSv1.3 suites can only | |
+specifications do _not_ apply to TLSv1.3 ciphers. The TLSv1.3 suites can only | |
be enabled by including their full name in the cipher list. They cannot, for | |
example, be enabled or disabled by using the legacy TLSv1.2 `'EECDH'` or | |
`'!EECDH'` specification. | |
@@ -347,7 +348,7 @@ used only if absolutely necessary. | |
The default cipher suite prefers GCM ciphers for [Chrome's 'modern | |
cryptography' setting][] and also prefers ECDHE and DHE ciphers for perfect | |
-forward secrecy, while offering *some* backward compatibility. | |
+forward secrecy, while offering _some_ backward compatibility. | |
128 bit AES is preferred over 192 and 256 bit AES in light of [specific | |
attacks affecting larger AES key sizes][]. | |
@@ -430,7 +434,7 @@ deprecated: v0.11.3 | |
--> | |
The `cryptoStream.bytesWritten` property returns the total number of bytes | |
-written to the underlying socket *including* the bytes required for the | |
+written to the underlying socket _including_ the bytes required for the | |
implementation of the TLS protocol. | |
## Class: `tls.SecurePair` | |
@@ -779,9 +801,9 @@ changes: | |
instantiated as a server. **Default:** `false`. | |
* `server` {net.Server} A [`net.Server`][] instance. | |
* `requestCert`: Whether to authenticate the remote peer by requesting a | |
- certificate. Clients always request a server certificate. Servers | |
- (`isServer` is true) may set `requestCert` to true to request a client | |
- certificate. | |
+ certificate. Clients always request a server certificate. Servers | |
+ (`isServer` is true) may set `requestCert` to true to request a client | |
+ certificate. | |
* `rejectUnauthorized`: See [`tls.createServer()`][] | |
* `ALPNProtocols`: See [`tls.createServer()`][] | |
* `SNICallback`: See [`tls.createServer()`][] | |
@@ -937,8 +968,7 @@ added: v12.2.0 | |
When enabled, TLS packet trace information is written to `stderr`. This can be | |
used to debug TLS connection problems. | |
-Note: The format of the output is identical to the output of `openssl s_client | |
--trace` or `openssl s_server -trace`. While it is produced by OpenSSL's | |
+Note: The format of the output is identical to the output of `openssl s_client -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's | |
`SSL_trace()` function, the format is undocumented, can change without notice, | |
and should not be relied on. | |
@@ -1034,7 +1072,7 @@ For example: | |
``` | |
See | |
-[SSL_CIPHER_get_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) | |
+[SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL\_CIPHER\_get\_name.html) | |
for more information. | |
### `tlsSocket.getEphemeralKeyInfo()` | |
@@ -1100,28 +1142,28 @@ certificate. | |
* `raw` {Buffer} The DER encoded X.509 certificate data. | |
* `subject` {Object} The certificate subject, described in terms of | |
- Country (`C:`), StateOrProvince (`ST`), Locality (`L`), Organization (`O`), | |
- OrganizationalUnit (`OU`), and CommonName (`CN`). The CommonName is typically | |
- a DNS name with TLS certificates. Example: | |
- `{C: 'UK', ST: 'BC', L: 'Metro', O: 'Node Fans', OU: 'Docs', CN: 'example.com'}`. | |
+ Country (`C:`), StateOrProvince (`ST`), Locality (`L`), Organization (`O`), | |
+ OrganizationalUnit (`OU`), and CommonName (`CN`). The CommonName is typically | |
+ a DNS name with TLS certificates. Example: | |
+ `{C: 'UK', ST: 'BC', L: 'Metro', O: 'Node Fans', OU: 'Docs', CN: 'example.com'}`. | |
* `issuer` {Object} The certificate issuer, described in the same terms as the | |
- `subject`. | |
+ `subject`. | |
* `valid_from` {string} The date-time the certificate is valid from. | |
* `valid_to` {string} The date-time the certificate is valid to. | |
* `serialNumber` {string} The certificate serial number, as a hex string. | |
- Example: `'B9B0D332A1AA5635'`. | |
+ Example: `'B9B0D332A1AA5635'`. | |
* `fingerprint` {string} The SHA-1 digest of the DER encoded certificate. It is | |
returned as a `:` separated hexadecimal string. Example: `'2A:7A:C2:DD:...'`. | |
* `fingerprint256` {string} The SHA-256 digest of the DER encoded certificate. | |
- It is returned as a `:` separated hexadecimal string. Example: | |
- `'2A:7A:C2:DD:...'`. | |
+ It is returned as a `:` separated hexadecimal string. Example: | |
+ `'2A:7A:C2:DD:...'`. | |
* `ext_key_usage` {Array} (Optional) The extended key usage, a set of OIDs. | |
* `subjectaltname` {string} (Optional) A string containing concatenated names | |
- for the subject, an alternative to the `subject` names. | |
+ for the subject, an alternative to the `subject` names. | |
* `infoAccess` {Array} (Optional) An array describing the AuthorityInfoAccess, | |
- used with OCSP. | |
+ used with OCSP. | |
* `issuerCertificate` {Object} (Optional) The issuer certificate object. For | |
- self-signed certificates, this may be a circular reference. | |
+ self-signed certificates, this may be a circular reference. | |
The certificate may contain information about the public key, depending on | |
the key type. | |
@@ -1132,7 +1174,7 @@ For RSA keys, the following properties may be defined: | |
* `exponent` {string} The RSA exponent, as a string in hexadecimal number | |
notation. Example: `'0x010001'`. | |
* `modulus` {string} The RSA modulus, as a hexadecimal string. Example: | |
- `'B56CE45CB7...'`. | |
+ `'B56CE45CB7...'`. | |
* `pubkey` {Buffer} The public key. | |
For EC keys, the following properties may be defined: | |
@@ -1254,7 +1302,7 @@ added: v12.11.0 | |
the client in the order of decreasing preference. | |
See | |
-[SSL_get_shared_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) | |
+[SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL\_get\_shared\_sigalgs.html) | |
for more information. | |
### `tlsSocket.getTLSTicket()` | |
@@ -1349,11 +1406,12 @@ added: v0.11.8 | |
verification fails; `err.code` contains the OpenSSL error code. **Default:** | |
`true`. | |
* `requestCert` | |
+ | |
* `callback` {Function} If `renegotiate()` returned `true`, callback is | |
- attached once to the `'secure'` event. If `renegotiate()` returned `false`, | |
- `callback` will be called in the next tick with an error, unless the | |
- `tlsSocket` has been destroyed, in which case `callback` will not be called | |
- at all. | |
+ attached once to the `'secure'` event. If `renegotiate()` returned `false`, | |
+ `callback` will be called in the next tick with an error, unless the | |
+ `tlsSocket` has been destroyed, in which case `callback` will not be called | |
+ at all. | |
* Returns: {boolean} `true` if renegotiation was initiated, `false` otherwise. | |
@@ -1504,7 +1566,7 @@ changes: | |
of the server against the certificate but that's not applicable for PSK | |
because there won't be a certificate present. | |
More information can be found in the [RFC 4279][]. | |
- * `ALPNProtocols`: {string[]|Buffer[]|TypedArray[]|DataView[]|Buffer| | |
+ * `ALPNProtocols`: {string\[]|Buffer\[]|TypedArray\[]|DataView\[]|Buffer| | |
TypedArray|DataView} | |
An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a | |
single `Buffer` or `TypedArray` or `DataView` containing the supported ALPN | |
@@ -1670,7 +1735,7 @@ changes: | |
--> | |
* `options` {Object} | |
- * `ca` {string|string[]|Buffer|Buffer[]} Optionally override the trusted CA | |
+ * `ca` {string|string\[]|Buffer|Buffer\[]} Optionally override the trusted CA | |
certificates. Default is to trust the well-known CAs curated by Mozilla. | |
Mozilla's CAs are completely replaced when CAs are explicitly specified | |
using this option. The value can be a string or `Buffer`, or an `Array` of | |
@@ -1688,20 +1753,20 @@ changes: | |
For PEM encoded certificates, supported types are "TRUSTED CERTIFICATE", | |
"X509 CERTIFICATE", and "CERTIFICATE". | |
See also [`tls.rootCertificates`][]. | |
- * `cert` {string|string[]|Buffer|Buffer[]} Cert chains in PEM format. One cert | |
- chain should be provided per private key. Each cert chain should consist of | |
- the PEM formatted certificate for a provided private `key`, followed by the | |
- PEM formatted intermediate certificates (if any), in order, and not | |
- including the root CA (the root CA must be pre-known to the peer, see `ca`). | |
- When providing multiple cert chains, they do not have to be in the same | |
- order as their private keys in `key`. If the intermediate certificates are | |
- not provided, the peer will not be able to validate the certificate, and the | |
- handshake will fail. | |
+ * `cert` {string|string\[]|Buffer|Buffer\[]} Cert chains in PEM format. One | |
+ cert chain should be provided per private key. Each cert chain should | |
+ consist of the PEM formatted certificate for a provided private `key`, | |
+ followed by the PEM formatted intermediate certificates (if any), in order, | |
+ and not including the root CA (the root CA must be pre-known to the peer, | |
+ see `ca`). When providing multiple cert chains, they do not have to be in | |
+ the same order as their private keys in `key`. If the intermediate | |
+ certificates are not provided, the peer will not be able to validate the | |
+ certificate, and the handshake will fail. | |
* `sigalgs` {string} Colon-separated list of supported signature algorithms. | |
The list can contain digest algorithms (`SHA256`, `MD5` etc.), public key | |
algorithms (`RSA-PSS`, `ECDSA` etc.), combination of both (e.g | |
'RSA+SHA384') or TLS v1.3 scheme names (e.g. `rsa_pss_pss_sha512`). | |
- See [OpenSSL man pages](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_sigalgs_list.html) | |
+ See [OpenSSL man pages](https://www.openssl.org/docs/man1.1.1/man3/SSL\_CTX\_set1\_sigalgs\_list.html) | |
for more info. | |
* `ciphers` {string} Cipher suite specification, replacing the default. For | |
more information, see [modifying the default cipher suite][]. Permitted | |
@@ -1709,7 +1774,7 @@ changes: | |
uppercased in order for OpenSSL to accept them. | |
* `clientCertEngine` {string} Name of an OpenSSL engine which can provide the | |
client certificate. | |
- * `crl` {string|string[]|Buffer|Buffer[]} PEM formatted CRLs (Certificate | |
+ * `crl` {string|string\[]|Buffer|Buffer\[]} PEM formatted CRLs (Certificate | |
Revocation Lists). | |
* `dhparam` {string|Buffer} Diffie-Hellman parameters, required for | |
[perfect forward secrecy][]. Use `openssl dhparam` to create the parameters. | |
@@ -1728,11 +1793,11 @@ changes: | |
preferences instead of the client's. When `true`, causes | |
`SSL_OP_CIPHER_SERVER_PREFERENCE` to be set in `secureOptions`, see | |
[OpenSSL Options][] for more information. | |
- * `key` {string|string[]|Buffer|Buffer[]|Object[]} Private keys in PEM format. | |
- PEM allows the option of private keys being encrypted. Encrypted keys will | |
- be decrypted with `options.passphrase`. Multiple keys using different | |
- algorithms can be provided either as an array of unencrypted key strings or | |
- buffers, or an array of objects in the form | |
+ * `key` {string|string\[]|Buffer|Buffer\[]|Object\[]} Private keys in PEM | |
+ format. PEM allows the option of private keys being encrypted. Encrypted | |
+ keys will be decrypted with `options.passphrase`. Multiple keys using | |
+ different algorithms can be provided either as an array of unencrypted key | |
+ strings or buffers, or an array of objects in the form | |
`{pem: <string|buffer>[, passphrase: <string>]}`. The object form can only | |
occur in an array. `object.passphrase` is optional. Encrypted keys will be | |
decrypted with `object.passphrase` if provided, or `options.passphrase` if | |
@@ -1755,7 +1820,7 @@ changes: | |
**Default:** [`tls.DEFAULT_MIN_VERSION`][]. | |
* `passphrase` {string} Shared passphrase used for a single private key and/or | |
a PFX. | |
- * `pfx` {string|string[]|Buffer|Buffer[]|Object[]} PFX or PKCS12 encoded | |
+ * `pfx` {string|string\[]|Buffer|Buffer\[]|Object\[]} PFX or PKCS12 encoded | |
private key and certificate chain. `pfx` is an alternative to providing | |
`key` and `cert` individually. PFX is usually encrypted, if it is, | |
`passphrase` will be used to decrypt it. Multiple PFX can be provided either | |
@@ -1772,9 +1837,9 @@ changes: | |
version to use, it does not support independent control of the minimum and | |
maximum version, and does not support limiting the protocol to TLSv1.3. Use | |
`minVersion` and `maxVersion` instead. The possible values are listed as | |
- [SSL_METHODS][], use the function names as strings. For example, use | |
- `'TLSv1_1_method'` to force TLS version 1.1, or `'TLS_method'` to allow any | |
- TLS protocol version up to TLSv1.3. It is not recommended to use TLS | |
+ [SSL\_METHODS][SSL_METHODS], use the function names as strings. For example, | |
+ use `'TLSv1_1_method'` to force TLS version 1.1, or `'TLS_method'` to allow | |
+ any TLS protocol version up to TLSv1.3. It is not recommended to use TLS | |
versions less than 1.2, but it may be required for interoperability. | |
**Default:** none, see `minVersion`. | |
* `sessionIdContext` {string} Opaque identifier used by servers to ensure | |
@@ -1796,7 +1861,7 @@ The `tls.createSecureContext()` method creates a `SecureContext` object. It is | |
usable as an argument to several `tls` APIs, such as [`tls.createServer()`][] | |
and [`server.addContext()`][], but has no public methods. | |
-A key is *required* for ciphers that use certificates. Either `key` or | |
+A key is _required_ for ciphers that use certificates. Either `key` or | |
`pfx` can be used to provide it. | |
If the `ca` option is not given, then Node.js will default to using | |
@@ -1886,7 +1953,7 @@ changes: | |
--> | |
* `options` {Object} | |
- * `ALPNProtocols`: {string[]|Buffer[]|TypedArray[]|DataView[]|Buffer| | |
+ * `ALPNProtocols`: {string\[]|Buffer\[]|TypedArray\[]|DataView\[]|Buffer| | |
TypedArray|DataView} | |
An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a single | |
`Buffer` or `TypedArray` or `DataView` containing the supported ALPN | |
@@ -1935,10 +2003,10 @@ changes: | |
When negotiating TLS-PSK (pre-shared keys), this function is called | |
with the identity provided by the client. | |
If the return value is `null` the negotiation process will stop and an | |
- "unknown_psk_identity" alert message will be sent to the other party. | |
+ "unknown\_psk\_identity" alert message will be sent to the other party. | |
If the server wishes to hide the fact that the PSK identity was not known, | |
the callback must provide some random data as `psk` to make the connection | |
- fail with "decrypt_error" before negotiation is finished. | |
+ fail with "decrypt\_error" before negotiation is finished. | |
PSK ciphers are disabled by default, and using TLS-PSK thus | |
requires explicitly specifying a cipher suite with the `ciphers` option. | |
More information can be found in the [RFC 4279][]. | |
@@ -1996,7 +2065,7 @@ The server can be tested by connecting to it using the example client from | |
added: v0.10.2 | |
--> | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns an array with the names of the supported TLS ciphers. The names are | |
lower-case for historical reasons, but must be uppercased to be used in | |
@@ -2014,7 +2084,7 @@ console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] | |
added: v12.3.0 | |
--> | |
-* {string[]} | |
+* {string\[]} | |
An immutable array of strings representing the root certificates (in PEM format) | |
from the bundled Mozilla CA store as supplied by current Node.js version. | |
diff --git a/doc/api/tracing.md b/doc/api/tracing.md | |
index 4b7a9bd8ff..d0b5ac4250 100644 | |
--- a/doc/api/tracing.md | |
+++ b/doc/api/tracing.md | |
@@ -44,7 +44,7 @@ node --trace-event-categories v8,node,node.async_hooks server.js | |
Prior versions of Node.js required the use of the `--trace-events-enabled` | |
flag to enable trace events. This requirement has been removed. However, the | |
-`--trace-events-enabled` flag *may* still be used and will enable the | |
+`--trace-events-enabled` flag _may_ still be used and will enable the | |
`node`, `node.async_hooks`, and `v8` trace event categories by default. | |
```bash | |
@@ -123,8 +127,8 @@ added: v10.0.0 | |
Disables this `Tracing` object. | |
-Only trace event categories *not* covered by other enabled `Tracing` objects | |
-and *not* specified by the `--trace-event-categories` flag will be disabled. | |
+Only trace event categories _not_ covered by other enabled `Tracing` objects | |
+and _not_ specified by the `--trace-event-categories` flag will be disabled. | |
```js | |
const trace_events = require('trace_events'); | |
@@ -163,7 +170,7 @@ added: v10.0.0 | |
--> | |
* `options` {Object} | |
- * `categories` {string[]} An array of trace category names. Values included | |
+ * `categories` {string\[]} An array of trace category names. Values included | |
in the array are coerced to a string when possible. An error will be | |
thrown if the value cannot be coerced. | |
* Returns: {Tracing}. | |
@@ -188,7 +196,7 @@ added: v10.0.0 | |
Returns a comma-separated list of all currently-enabled trace event | |
categories. The current set of enabled trace event categories is determined | |
-by the *union* of all currently-enabled `Tracing` objects and any categories | |
+by the _union_ of all currently-enabled `Tracing` objects and any categories | |
enabled using the `--trace-event-categories` flag. | |
Given the file `test.js` below, the command | |
diff --git a/doc/api/tty.md b/doc/api/tty.md | |
index 10eb874e56..ea0640274f 100644 | |
--- a/doc/api/tty.md | |
+++ b/doc/api/tty.md | |
@@ -73,10 +77,12 @@ Allows configuration of `tty.ReadStream` so that it operates as a raw device. | |
When in raw mode, input is always available character-by-character, not | |
including modifiers. Additionally, all special processing of characters by the | |
-terminal is disabled, including echoing input characters. | |
-<kbd>Ctrl</kbd>+<kbd>C</kbd> will no longer cause a `SIGINT` when in this mode. | |
+terminal is disabled, including echoing input | |
+characters. <kbd>Ctrl</kbd>+<kbd>C</kbd> will no longer cause a `SIGINT` when | |
+in this mode. | |
## Class: `tty.WriteStream` | |
+ | |
<!-- YAML | |
added: v0.5.8 | |
--> | |
@@ -208,7 +221,7 @@ Disabling color support is also possible by using the `NO_COLOR` and | |
added: v0.7.7 | |
--> | |
-* Returns: {number[]} | |
+* Returns: {number\[]} | |
`writeStream.getWindowSize()` returns the size of the TTY | |
corresponding to this `WriteStream`. The array is of the type | |
@@ -269,7 +285,7 @@ changes: | |
for the `'drain'` event to be emitted before continuing to write additional | |
data; otherwise `true`. | |
-`writeStream.moveCursor()` moves this `WriteStream`'s cursor *relative* to its | |
+`writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its | |
current position. | |
### `writeStream.rows` | |
diff --git a/doc/api/url.md b/doc/api/url.md | |
index 1f3f510a18..19e9df5245 100644 | |
--- a/doc/api/url.md | |
+++ b/doc/api/url.md | |
@@ -242,7 +243,7 @@ Invalid host values assigned to the `host` property are ignored. | |
* {string} | |
Gets and sets the host name portion of the URL. The key difference between | |
-`url.host` and `url.hostname` is that `url.hostname` does *not* include the | |
+`url.host` and `url.hostname` is that `url.hostname` does _not_ include the | |
port. | |
```js | |
@@ -869,7 +878,7 @@ are no such pairs, `null` is returned. | |
#### `urlSearchParams.getAll(name)` | |
* `name` {string} | |
-* Returns: {string[]} | |
+* Returns: {string\[]} | |
Returns the values of all name-value pairs whose name is `name`. If there are | |
no such pairs, an empty array is returned. | |
@@ -1312,7 +1330,7 @@ For example: `'sub.example.com:8080'`. | |
#### `urlObject.hostname` | |
The `hostname` property is the lower-cased host name portion of the `host` | |
-component *without* the `port` included. | |
+component _without_ the `port` included. | |
For example: `'sub.example.com'`. | |
@@ -1440,7 +1459,7 @@ The formatting process operates as follows: | |
* If `urlObject.protocol` is a string, it is appended as-is to `result`. | |
* Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an | |
[`Error`][] is thrown. | |
-* For all string values of `urlObject.protocol` that *do not end* with an ASCII | |
+* For all string values of `urlObject.protocol` that _do not end_ with an ASCII | |
colon (`:`) character, the literal string `:` will be appended to `result`. | |
* If either of the following conditions is true, then the literal string `//` | |
will be appended to `result`: | |
@@ -1450,7 +1469,7 @@ The formatting process operates as follows: | |
* If the value of the `urlObject.auth` property is truthy, and either | |
`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of | |
`urlObject.auth` will be coerced into a string and appended to `result` | |
- followed by the literal string `@`. | |
+ followed by the literal string `@`. | |
* If the `urlObject.host` property is `undefined` then: | |
* If the `urlObject.hostname` is a string, it is appended to `result`. | |
* Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, | |
@@ -1463,7 +1482,7 @@ The formatting process operates as follows: | |
* Otherwise, if the `urlObject.host` property value is truthy, the value of | |
`urlObject.host` is coerced to a string and appended to `result`. | |
* If the `urlObject.pathname` property is a string that is not an empty string: | |
- * If the `urlObject.pathname` *does not start* with an ASCII forward slash | |
+ * If the `urlObject.pathname` _does not start_ with an ASCII forward slash | |
(`/`), then the literal string `'/'` is appended to `result`. | |
* The value of `urlObject.pathname` is appended to `result`. | |
* Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an | |
@@ -1473,13 +1492,13 @@ The formatting process operates as follows: | |
followed by the output of calling the [`querystring`][] module's `stringify()` | |
method passing the value of `urlObject.query`. | |
* Otherwise, if `urlObject.search` is a string: | |
- * If the value of `urlObject.search` *does not start* with the ASCII question | |
+ * If the value of `urlObject.search` _does not start_ with the ASCII question | |
mark (`?`) character, the literal string `?` is appended to `result`. | |
* The value of `urlObject.search` is appended to `result`. | |
* Otherwise, if `urlObject.search` is not `undefined` and is not a string, an | |
[`Error`][] is thrown. | |
* If the `urlObject.hash` property is a string: | |
- * If the value of `urlObject.hash` *does not start* with the ASCII hash (`#`) | |
+ * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) | |
character, the literal string `#` is appended to `result`. | |
* The value of `urlObject.hash` is appended to `result`. | |
* Otherwise, if the `urlObject.hash` property is not `undefined` and is not a | |
@@ -1623,29 +1645,29 @@ selecting encoded characters than that used by the Legacy API. | |
The WHATWG algorithm defines four "percent-encode sets" that describe ranges | |
of characters that must be percent-encoded: | |
-* The *C0 control percent-encode set* includes code points in range U+0000 to | |
+* The _C0 control percent-encode set_ includes code points in range U+0000 to | |
U+001F (inclusive) and all code points greater than U+007E. | |
-* The *fragment percent-encode set* includes the *C0 control percent-encode set* | |
+* The _fragment percent-encode set_ includes the _C0 control percent-encode set_ | |
and code points U+0020, U+0022, U+003C, U+003E, and U+0060. | |
-* The *path percent-encode set* includes the *C0 control percent-encode set* | |
+* The _path percent-encode set_ includes the _C0 control percent-encode set_ | |
and code points U+0020, U+0022, U+0023, U+003C, U+003E, U+003F, U+0060, | |
U+007B, and U+007D. | |
-* The *userinfo encode set* includes the *path percent-encode set* and code | |
+* The _userinfo encode set_ includes the _path percent-encode set_ and code | |
points U+002F, U+003A, U+003B, U+003D, U+0040, U+005B, U+005C, U+005D, | |
U+005E, and U+007C. | |
-The *userinfo percent-encode set* is used exclusively for username and | |
-passwords encoded within the URL. The *path percent-encode set* is used for the | |
-path of most URLs. The *fragment percent-encode set* is used for URL fragments. | |
-The *C0 control percent-encode set* is used for host and path under certain | |
+The _userinfo percent-encode set_ is used exclusively for username and | |
+passwords encoded within the URL. The _path percent-encode set_ is used for the | |
+path of most URLs. The _fragment percent-encode set_ is used for URL fragments. | |
+The _C0 control percent-encode set_ is used for host and path under certain | |
specific conditions, in addition to all other cases. | |
When non-ASCII characters appear within a host name, the host name is encoded | |
-using the [Punycode][] algorithm. Note, however, that a host name *may* contain | |
-*both* Punycode encoded and percent-encoded characters: | |
+using the [Punycode][] algorithm. Note, however, that a host name _may_ contain | |
+_both_ Punycode encoded and percent-encoded characters: | |
```js | |
const myURL = new URL('https://%CF%80.example.com/foo'); | |
diff --git a/doc/api/util.md b/doc/api/util.md | |
index 24c90dd407..3810b1145c 100644 | |
--- a/doc/api/util.md | |
+++ b/doc/api/util.md | |
@@ -218,7 +223,7 @@ fn2(); // Does not emit a deprecation warning because it has the same code | |
``` | |
If either the `--no-deprecation` or `--no-warnings` command-line flags are | |
-used, or if the `process.noDeprecation` property is set to `true` *prior* to | |
+used, or if the `process.noDeprecation` property is set to `true` _prior_ to | |
the first deprecation warning, the `util.deprecate()` method does nothing. | |
If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, | |
@@ -1154,47 +1173,47 @@ Different Node.js build configurations support different sets of encodings. | |
#### Encodings supported by default (with full ICU data) | |
-| Encoding | Aliases | | |
-| ----------------- | -------------------------------- | | |
-| `'ibm866'` | `'866'`, `'cp866'`, `'csibm866'` | | |
-| `'iso-8859-2'` | `'csisolatin2'`, `'iso-ir-101'`, `'iso8859-2'`, `'iso88592'`, `'iso_8859-2'`, `'iso_8859-2:1987'`, `'l2'`, `'latin2'` | | |
-| `'iso-8859-3'` | `'csisolatin3'`, `'iso-ir-109'`, `'iso8859-3'`, `'iso88593'`, `'iso_8859-3'`, `'iso_8859-3:1988'`, `'l3'`, `'latin3'` | | |
-| `'iso-8859-4'` | `'csisolatin4'`, `'iso-ir-110'`, `'iso8859-4'`, `'iso88594'`, `'iso_8859-4'`, `'iso_8859-4:1988'`, `'l4'`, `'latin4'` | | |
-| `'iso-8859-5'` | `'csisolatincyrillic'`, `'cyrillic'`, `'iso-ir-144'`, `'iso8859-5'`, `'iso88595'`, `'iso_8859-5'`, `'iso_8859-5:1988'` | | |
-| `'iso-8859-6'` | `'arabic'`, `'asmo-708'`, `'csiso88596e'`, `'csiso88596i'`, `'csisolatinarabic'`, `'ecma-114'`, `'iso-8859-6-e'`, `'iso-8859-6-i'`, `'iso-ir-127'`, `'iso8859-6'`, `'iso88596'`, `'iso_8859-6'`, `'iso_8859-6:1987'` | | |
-| `'iso-8859-7'` | `'csisolatingreek'`, `'ecma-118'`, `'elot_928'`, `'greek'`, `'greek8'`, `'iso-ir-126'`, `'iso8859-7'`, `'iso88597'`, `'iso_8859-7'`, `'iso_8859-7:1987'`, `'sun_eu_greek'` | | |
-| `'iso-8859-8'` | `'csiso88598e'`, `'csisolatinhebrew'`, `'hebrew'`, `'iso-8859-8-e'`, `'iso-ir-138'`, `'iso8859-8'`, `'iso88598'`, `'iso_8859-8'`, `'iso_8859-8:1988'`, `'visual'` | | |
-| `'iso-8859-8-i'` | `'csiso88598i'`, `'logical'` | | |
-| `'iso-8859-10'` | `'csisolatin6'`, `'iso-ir-157'`, `'iso8859-10'`, `'iso885910'`, `'l6'`, `'latin6'` | | |
-| `'iso-8859-13'` | `'iso8859-13'`, `'iso885913'` | | |
-| `'iso-8859-14'` | `'iso8859-14'`, `'iso885914'` | | |
-| `'iso-8859-15'` | `'csisolatin9'`, `'iso8859-15'`, `'iso885915'`, `'iso_8859-15'`, `'l9'` | | |
-| `'koi8-r'` | `'cskoi8r'`, `'koi'`, `'koi8'`, `'koi8_r'` | | |
-| `'koi8-u'` | `'koi8-ru'` | | |
-| `'macintosh'` | `'csmacintosh'`, `'mac'`, `'x-mac-roman'` | | |
-| `'windows-874'` | `'dos-874'`, `'iso-8859-11'`, `'iso8859-11'`, `'iso885911'`, `'tis-620'` | | |
-| `'windows-1250'` | `'cp1250'`, `'x-cp1250'` | | |
-| `'windows-1251'` | `'cp1251'`, `'x-cp1251'` | | |
+| Encoding | Aliases | | |
+| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | |
+| `'ibm866'` | `'866'`, `'cp866'`, `'csibm866'` | | |
+| `'iso-8859-2'` | `'csisolatin2'`, `'iso-ir-101'`, `'iso8859-2'`, `'iso88592'`, `'iso_8859-2'`, `'iso_8859-2:1987'`, `'l2'`, `'latin2'` | | |
+| `'iso-8859-3'` | `'csisolatin3'`, `'iso-ir-109'`, `'iso8859-3'`, `'iso88593'`, `'iso_8859-3'`, `'iso_8859-3:1988'`, `'l3'`, `'latin3'` | | |
+| `'iso-8859-4'` | `'csisolatin4'`, `'iso-ir-110'`, `'iso8859-4'`, `'iso88594'`, `'iso_8859-4'`, `'iso_8859-4:1988'`, `'l4'`, `'latin4'` | | |
+| `'iso-8859-5'` | `'csisolatincyrillic'`, `'cyrillic'`, `'iso-ir-144'`, `'iso8859-5'`, `'iso88595'`, `'iso_8859-5'`, `'iso_8859-5:1988'` | | |
+| `'iso-8859-6'` | `'arabic'`, `'asmo-708'`, `'csiso88596e'`, `'csiso88596i'`, `'csisolatinarabic'`, `'ecma-114'`, `'iso-8859-6-e'`, `'iso-8859-6-i'`, `'iso-ir-127'`, `'iso8859-6'`, `'iso88596'`, `'iso_8859-6'`, `'iso_8859-6:1987'` | | |
+| `'iso-8859-7'` | `'csisolatingreek'`, `'ecma-118'`, `'elot_928'`, `'greek'`, `'greek8'`, `'iso-ir-126'`, `'iso8859-7'`, `'iso88597'`, `'iso_8859-7'`, `'iso_8859-7:1987'`, `'sun_eu_greek'` | | |
+| `'iso-8859-8'` | `'csiso88598e'`, `'csisolatinhebrew'`, `'hebrew'`, `'iso-8859-8-e'`, `'iso-ir-138'`, `'iso8859-8'`, `'iso88598'`, `'iso_8859-8'`, `'iso_8859-8:1988'`, `'visual'` | | |
+| `'iso-8859-8-i'` | `'csiso88598i'`, `'logical'` | | |
+| `'iso-8859-10'` | `'csisolatin6'`, `'iso-ir-157'`, `'iso8859-10'`, `'iso885910'`, `'l6'`, `'latin6'` | | |
+| `'iso-8859-13'` | `'iso8859-13'`, `'iso885913'` | | |
+| `'iso-8859-14'` | `'iso8859-14'`, `'iso885914'` | | |
+| `'iso-8859-15'` | `'csisolatin9'`, `'iso8859-15'`, `'iso885915'`, `'iso_8859-15'`, `'l9'` | | |
+| `'koi8-r'` | `'cskoi8r'`, `'koi'`, `'koi8'`, `'koi8_r'` | | |
+| `'koi8-u'` | `'koi8-ru'` | | |
+| `'macintosh'` | `'csmacintosh'`, `'mac'`, `'x-mac-roman'` | | |
+| `'windows-874'` | `'dos-874'`, `'iso-8859-11'`, `'iso8859-11'`, `'iso885911'`, `'tis-620'` | | |
+| `'windows-1250'` | `'cp1250'`, `'x-cp1250'` | | |
+| `'windows-1251'` | `'cp1251'`, `'x-cp1251'` | | |
| `'windows-1252'` | `'ansi_x3.4-1968'`, `'ascii'`, `'cp1252'`, `'cp819'`, `'csisolatin1'`, `'ibm819'`, `'iso-8859-1'`, `'iso-ir-100'`, `'iso8859-1'`, `'iso88591'`, `'iso_8859-1'`, `'iso_8859-1:1987'`, `'l1'`, `'latin1'`, `'us-ascii'`, `'x-cp1252'` | | |
-| `'windows-1253'` | `'cp1253'`, `'x-cp1253'` | | |
-| `'windows-1254'` | `'cp1254'`, `'csisolatin5'`, `'iso-8859-9'`, `'iso-ir-148'`, `'iso8859-9'`, `'iso88599'`, `'iso_8859-9'`, `'iso_8859-9:1989'`, `'l5'`, `'latin5'`, `'x-cp1254'` | | |
-| `'windows-1255'` | `'cp1255'`, `'x-cp1255'` | | |
-| `'windows-1256'` | `'cp1256'`, `'x-cp1256'` | | |
-| `'windows-1257'` | `'cp1257'`, `'x-cp1257'` | | |
-| `'windows-1258'` | `'cp1258'`, `'x-cp1258'` | | |
-| `'x-mac-cyrillic'` | `'x-mac-ukrainian'` | | |
-| `'gbk'` | `'chinese'`, `'csgb2312'`, `'csiso58gb231280'`, `'gb2312'`, `'gb_2312'`, `'gb_2312-80'`, `'iso-ir-58'`, `'x-gbk'` | | |
-| `'gb18030'` | | | |
-| `'big5'` | `'big5-hkscs'`, `'cn-big5'`, `'csbig5'`, `'x-x-big5'` | | |
-| `'euc-jp'` | `'cseucpkdfmtjapanese'`, `'x-euc-jp'` | | |
-| `'iso-2022-jp'` | `'csiso2022jp'` | | |
-| `'shift_jis'` | `'csshiftjis'`, `'ms932'`, `'ms_kanji'`, `'shift-jis'`, `'sjis'`, `'windows-31j'`, `'x-sjis'` | | |
-| `'euc-kr'` | `'cseuckr'`, `'csksc56011987'`, `'iso-ir-149'`, `'korean'`, `'ks_c_5601-1987'`, `'ks_c_5601-1989'`, `'ksc5601'`, `'ksc_5601'`, `'windows-949'` | | |
+| `'windows-1253'` | `'cp1253'`, `'x-cp1253'` | | |
+| `'windows-1254'` | `'cp1254'`, `'csisolatin5'`, `'iso-8859-9'`, `'iso-ir-148'`, `'iso8859-9'`, `'iso88599'`, `'iso_8859-9'`, `'iso_8859-9:1989'`, `'l5'`, `'latin5'`, `'x-cp1254'` | | |
+| `'windows-1255'` | `'cp1255'`, `'x-cp1255'` | | |
+| `'windows-1256'` | `'cp1256'`, `'x-cp1256'` | | |
+| `'windows-1257'` | `'cp1257'`, `'x-cp1257'` | | |
+| `'windows-1258'` | `'cp1258'`, `'x-cp1258'` | | |
+| `'x-mac-cyrillic'` | `'x-mac-ukrainian'` | | |
+| `'gbk'` | `'chinese'`, `'csgb2312'`, `'csiso58gb231280'`, `'gb2312'`, `'gb_2312'`, `'gb_2312-80'`, `'iso-ir-58'`, `'x-gbk'` | | |
+| `'gb18030'` | | | |
+| `'big5'` | `'big5-hkscs'`, `'cn-big5'`, `'csbig5'`, `'x-x-big5'` | | |
+| `'euc-jp'` | `'cseucpkdfmtjapanese'`, `'x-euc-jp'` | | |
+| `'iso-2022-jp'` | `'csiso2022jp'` | | |
+| `'shift_jis'` | `'csshiftjis'`, `'ms932'`, `'ms_kanji'`, `'shift-jis'`, `'sjis'`, `'windows-31j'`, `'x-sjis'` | | |
+| `'euc-kr'` | `'cseuckr'`, `'csksc56011987'`, `'iso-ir-149'`, `'korean'`, `'ks_c_5601-1987'`, `'ks_c_5601-1989'`, `'ksc5601'`, `'ksc_5601'`, `'windows-949'` | | |
#### Encodings supported when Node.js is built with the `small-icu` option | |
| Encoding | Aliases | | |
-| ----------- | ------------------------------- | | |
+| ------------ | ------------------------------- | | |
| `'utf-8'` | `'unicode-1-1-utf-8'`, `'utf8'` | | |
| `'utf-16le'` | `'utf-16'` | | |
| `'utf-16be'` | | | |
@@ -1202,7 +1221,7 @@ Different Node.js build configurations support different sets of encodings. | |
#### Encodings supported when ICU is disabled | |
| Encoding | Aliases | | |
-| ----------- | ------------------------------- | | |
+| ------------ | ------------------------------- | | |
| `'utf-8'` | `'unicode-1-1-utf-8'`, `'utf8'` | | |
| `'utf-16le'` | `'utf-16'` | | |
@@ -1225,9 +1245,9 @@ changes: | |
This option is not supported when ICU is disabled | |
(see [Internationalization][]). **Default:** `false`. | |
* `ignoreBOM` {boolean} When `true`, the `TextDecoder` will include the byte | |
- order mark in the decoded result. When `false`, the byte order mark will | |
- be removed from the output. This option is only used when `encoding` is | |
- `'utf-8'`, `'utf-16be'` or `'utf-16le'`. **Default:** `false`. | |
+ order mark in the decoded result. When `false`, the byte order mark will | |
+ be removed from the output. This option is only used when `encoding` is | |
+ `'utf-8'`, `'utf-16be'` or `'utf-16le'`. **Default:** `false`. | |
Creates an new `TextDecoder` instance. The `encoding` may specify one of the | |
supported encodings or an alias. | |
@@ -1418,7 +1446,7 @@ added: v10.0.0 | |
* Returns: {boolean} | |
Returns `true` if the value is a built-in [`ArrayBuffer`][] instance. | |
-This does *not* include [`SharedArrayBuffer`][] instances. Usually, it is | |
+This does _not_ include [`SharedArrayBuffer`][] instances. Usually, it is | |
desirable to test for both; See [`util.types.isAnyArrayBuffer()`][] for that. | |
```js | |
@@ -1900,7 +1957,7 @@ added: v10.0.0 | |
* Returns: {boolean} | |
Returns `true` if the value is a built-in [`SharedArrayBuffer`][] instance. | |
-This does *not* include [`ArrayBuffer`][] instances. Usually, it is | |
+This does _not_ include [`ArrayBuffer`][] instances. Usually, it is | |
desirable to test for both; See [`util.types.isAnyArrayBuffer()`][] for that. | |
```js | |
diff --git a/doc/api/v8.md b/doc/api/v8.md | |
index d4972163cc..4eb6aa6f90 100644 | |
--- a/doc/api/v8.md | |
+++ b/doc/api/v8.md | |
@@ -83,7 +88,7 @@ changes: | |
description: Support values exceeding the 32-bit unsigned integer range. | |
--> | |
-* Returns: {Object[]} | |
+* Returns: {Object\[]} | |
Returns statistics about the V8 heap spaces, i.e. the segments which make up | |
the V8 heap. Neither the ordering of heap spaces, nor the availability of a | |
@@ -174,11 +180,11 @@ garbage with a bit pattern. The RSS footprint (resident set size) gets bigger | |
because it continuously touches all heap pages and that makes them less likely | |
to get swapped out by the operating system. | |
-`number_of_native_contexts` The value of native_context is the number of the | |
+`number_of_native_contexts` The value of native\_context is the number of the | |
top-level contexts currently active. Increase of this number over time indicates | |
a memory leak. | |
-`number_of_detached_contexts` The value of detached_context is the number | |
+`number_of_detached_contexts` The value of detached\_context is the number | |
of contexts that were detached and not yet garbage collected. This number | |
being non-zero indicates a potential memory leak. | |
@@ -495,7 +509,7 @@ For use inside of a custom [`deserializer._readHostObject()`][]. | |
#### `deserializer.readUint64()` | |
-* Returns: {integer[]} | |
+* Returns: {integer\[]} | |
Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]` | |
with two 32-bit unsigned integer entries. | |
diff --git a/doc/api/vm.md b/doc/api/vm.md | |
index 7a8dc946b1..6b6bbf23e0 100644 | |
--- a/doc/api/vm.md | |
+++ b/doc/api/vm.md | |
@@ -78,8 +80,8 @@ changes: | |
is displayed in stack traces produced by this script. **Default:** `0`. | |
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or | |
`TypedArray`, or `DataView` with V8's code cache data for the supplied | |
- source. When supplied, the `cachedDataRejected` value will be set to | |
- either `true` or `false` depending on acceptance of the data by V8. | |
+ source. When supplied, the `cachedDataRejected` value will be set to | |
+ either `true` or `false` depending on acceptance of the data by V8. | |
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8 | |
will attempt to produce code cache data for `code`. Upon success, a | |
`Buffer` with V8's code cache data will be produced and stored in the | |
@@ -288,7 +294,7 @@ changes: | |
Runs the compiled code contained by the `vm.Script` within the context of the | |
current `global` object. Running code does not have access to local scope, but | |
-*does* have access to the current `global` object. | |
+_does_ have access to the current `global` object. | |
The following example compiles code that increments a `global` variable then | |
executes that code multiple times: | |
@@ -485,7 +492,7 @@ const contextifiedObject = vm.createContext({ | |
### `module.dependencySpecifiers` | |
-* {string[]} | |
+* {string\[]} | |
The specifiers of all dependencies of this module. The returned array is frozen | |
to disallow any changes to it. | |
@@ -664,8 +675,8 @@ changes: | |
index. | |
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or | |
`TypedArray`, or `DataView` with V8's code cache data for the supplied | |
- source. The `code` must be the same as the module from which this | |
- `cachedData` was created. | |
+ source. The `code` must be the same as the module from which this | |
+ `cachedData` was created. | |
* `context` {Object} The [contextified][] object as returned by the | |
`vm.createContext()` method, to compile and evaluate this `Module` in. | |
* `lineOffset` {integer} Specifies the line number offset that is displayed | |
@@ -811,7 +825,8 @@ added: | |
- v12.16.0 | |
--> | |
-* `exportNames` {string[]} Array of names that will be exported from the module. | |
+* `exportNames` {string\[]} Array of names that will be exported from the | |
+ module. | |
* `evaluateCallback` {Function} Called when the module is evaluated. | |
* `options` | |
* `identifier` {string} String used in stack traces. | |
@@ -888,7 +905,7 @@ changes: | |
--> | |
* `code` {string} The body of the function to compile. | |
-* `params` {string[]} An array of strings containing all parameters for the | |
+* `params` {string\[]} An array of strings containing all parameters for the | |
function. | |
* `options` {Object} | |
* `filename` {string} Specifies the filename used in stack traces produced | |
@@ -899,12 +916,12 @@ changes: | |
is displayed in stack traces produced by this script. **Default:** `0`. | |
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or | |
`TypedArray`, or `DataView` with V8's code cache data for the supplied | |
- source. | |
+ source. | |
* `produceCachedData` {boolean} Specifies whether to produce new cache data. | |
**Default:** `false`. | |
* `parsingContext` {Object} The [contextified][] object in which the said | |
function should be compiled in. | |
- * `contextExtensions` {Object[]} An array containing a collection of context | |
+ * `contextExtensions` {Object\[]} An array containing a collection of context | |
extensions (objects wrapping the current scope) to be applied while | |
compiling. **Default:** `[]`. | |
* `importModuleDynamically` {Function} Called during evaluation of this module | |
@@ -1124,8 +1144,8 @@ changes: | |
work after that. **Default:** `false`. | |
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or | |
`TypedArray`, or `DataView` with V8's code cache data for the supplied | |
- source. When supplied, the `cachedDataRejected` value will be set to | |
- either `true` or `false` depending on acceptance of the data by V8. | |
+ source. When supplied, the `cachedDataRejected` value will be set to | |
+ either `true` or `false` depending on acceptance of the data by V8. | |
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8 | |
will attempt to produce code cache data for `code`. Upon success, a | |
`Buffer` with V8's code cache data will be produced and stored in the | |
@@ -1151,7 +1171,7 @@ changes: | |
The `vm.runInContext()` method compiles `code`, runs it within the context of | |
the `contextifiedObject`, then returns the result. Running code does not have | |
-access to the local scope. The `contextifiedObject` object *must* have been | |
+access to the local scope. The `contextifiedObject` object _must_ have been | |
previously [contextified][] using the [`vm.createContext()`][] method. | |
If `options` is a string, then it specifies the filename. | |
@@ -1229,8 +1250,8 @@ changes: | |
module will throw a `WebAssembly.CompileError`. **Default:** `true`. | |
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or | |
`TypedArray`, or `DataView` with V8's code cache data for the supplied | |
- source. When supplied, the `cachedDataRejected` value will be set to | |
- either `true` or `false` depending on acceptance of the data by V8. | |
+ source. When supplied, the `cachedDataRejected` value will be set to | |
+ either `true` or `false` depending on acceptance of the data by V8. | |
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8 | |
will attempt to produce code cache data for `code`. Upon success, a | |
`Buffer` with V8's code cache data will be produced and stored in the | |
@@ -1315,8 +1337,8 @@ changes: | |
work after that. **Default:** `false`. | |
* `cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or | |
`TypedArray`, or `DataView` with V8's code cache data for the supplied | |
- source. When supplied, the `cachedDataRejected` value will be set to | |
- either `true` or `false` depending on acceptance of the data by V8. | |
+ source. When supplied, the `cachedDataRejected` value will be set to | |
+ either `true` or `false` depending on acceptance of the data by V8. | |
* `produceCachedData` {boolean} When `true` and no `cachedData` is present, V8 | |
will attempt to produce code cache data for `code`. Upon success, a | |
`Buffer` with V8's code cache data will be produced and stored in the | |
@@ -1364,7 +1387,7 @@ console.log(`evalResult: '${evalResult}', localVar: '${localVar}'`); | |
``` | |
Because `vm.runInThisContext()` does not have access to the local scope, | |
-`localVar` is unchanged. In contrast, [`eval()`][] *does* have access to the | |
+`localVar` is unchanged. In contrast, [`eval()`][] _does_ have access to the | |
local scope, so the value `localVar` is changed. In this way | |
`vm.runInThisContext()` is much like an [indirect `eval()` call][], e.g. | |
`(0,eval)('code')`. | |
diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md | |
index 2d89abbf1c..0a860d7447 100644 | |
--- a/doc/api/webcrypto.md | |
+++ b/doc/api/webcrypto.md | |
@@ -306,28 +306,28 @@ async function digest(data, algorithm = 'SHA-512') { | |
The table details the algorithms supported by the Node.js Web Crypto API | |
implementation and the APIs supported for each: | |
-| Algorithm | `generateKey` | `exportKey` | `importKey` | `encrypt` | `decrypt` | `wrapKey` | `unwrapKey` | `deriveBits` | `deriveKey` | `sign` | `verify` | `digest` | | |
-| --------------------- | ------------- | ----------- | ----------- | --------- | --------- | --------- | ----------- | ------------ | ----------- | ------ | -------- | -------- | | |
-| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
-| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
-| `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
-| `'ECDSA'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
-| `'ECDH'` | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
-| `'AES-CTR'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
-| `'AES-CBC'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
-| `'AES-GCM'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
-| `'AES-KW'` | ✔ | ✔ | ✔ | | | ✔ | ✔ | | | | | | | |
-| `'HMAC'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
-| `'HKDF'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
-| `'PBKDF2'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
-| `'SHA-1'` | | | | | | | | | | | | ✔ | | |
-| `'SHA-256'` | | | | | | | | | | | | ✔ | | |
-| `'SHA-384'` | | | | | | | | | | | | ✔ | | |
-| `'SHA-512'` | | | | | | | | | | | | ✔ | | |
-| `'NODE-DSA'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
-| `'NODE-DH'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
-| `'NODE-ED25519'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
-| `'NODE-ED448'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| Algorithm | `generateKey` | `exportKey` | `importKey` | `encrypt` | `decrypt` | `wrapKey` | `unwrapKey` | `deriveBits` | `deriveKey` | `sign` | `verify` | `digest` | | |
+| ---------------------------- | ------------- | ----------- | ----------- | --------- | --------- | --------- | ----------- | ------------ | ----------- | ------ | -------- | -------- | | |
+| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
+| `'ECDSA'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| `'ECDH'` | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
+| `'AES-CTR'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
+| `'AES-CBC'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
+| `'AES-GCM'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | | |
+| `'AES-KW'` | ✔ | ✔ | ✔ | | | ✔ | ✔ | | | | | | | |
+| `'HMAC'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| `'HKDF'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
+| `'PBKDF2'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
+| `'SHA-1'` | | | | | | | | | | | | ✔ | | |
+| `'SHA-256'` | | | | | | | | | | | | ✔ | | |
+| `'SHA-384'` | | | | | | | | | | | | ✔ | | |
+| `'SHA-512'` | | | | | | | | | | | | ✔ | | |
+| `'NODE-DSA'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| `'NODE-DH'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | | |
+| `'NODE-ED25519'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
+| `'NODE-ED448'`<sup>1</sup> | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | | |
<sup>1</sup> Node.js-specific extension | |
@@ -417,7 +428,7 @@ asymmetric (`'private'` or `'public'`) key. | |
added: v15.0.0 | |
--> | |
-* Type: {string[]} | |
+* Type: {string\[]} | |
An array of strings identifying the operations for which the | |
key may be used. | |
@@ -436,25 +447,25 @@ The possible usages are: | |
Valid key usages depend on the key algorithm (identified by | |
`cryptokey.algorithm.name`). | |
-| Key Type | `'encrypt'` | `'decrypt'` | `'sign'` | `'verify'` | `'deriveKey'` | `'deriveBits'` | `'wrapKey'` | `'unwrapKey'` | | |
-| -------------------- | ----------- | ----------- | -------- | ---------- | ------------- | --------------- | ----------- | ------------- | | |
-| `'AES-CBC'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
-| `'AES-CTR'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
-| `'AES-GCM'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
-| `'AES-KW'` | | | | | | | ✔ | ✔ | | |
-| `'ECDH'` | | | | | ✔ | ✔ | | | | |
-| `'ECDSA'` | | | ✔ | ✔ | | | | | | |
-| `'HDKF'` | | | | | ✔ | ✔ | | | | |
-| `'HMAC'` | | | ✔ | ✔ | | | | | | |
-| `'PBKDF2'` | | | | | ✔ | ✔ | | | | |
-| `'RSA-OAEP'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
-| `'RSA-PSS'` | | | ✔ | ✔ | | | | | | |
-| `'RSASSA-PKCS1-v1_5'` | | | ✔ | ✔ | | | | | | |
-| `'NODE-DSA'` <sup>1</sup> | | | ✔ | ✔ | | | | | | |
-| `'NODE-DH'` <sup>1</sup> | | | | | ✔ | ✔ | | | | |
-| `'NODE-SCRYPT'` <sup>1</sup> | | | | | ✔ | ✔ | | | | |
-| `'NODE-ED25519'` <sup>1</sup> | | | ✔ | ✔ | | | | | | |
-| `'NODE-ED448'` <sup>1</sup> | | | ✔ | ✔ | | | | | | |
+| Key Type | `'encrypt'` | `'decrypt'` | `'sign'` | `'verify'` | `'deriveKey'` | `'deriveBits'` | `'wrapKey'` | `'unwrapKey'` | | |
+| ----------------------------- | ----------- | ----------- | -------- | ---------- | ------------- | -------------- | ----------- | ------------- | | |
+| `'AES-CBC'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
+| `'AES-CTR'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
+| `'AES-GCM'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
+| `'AES-KW'` | | | | | | | ✔ | ✔ | | |
+| `'ECDH'` | | | | | ✔ | ✔ | | | | |
+| `'ECDSA'` | | | ✔ | ✔ | | | | | | |
+| `'HDKF'` | | | | | ✔ | ✔ | | | | |
+| `'HMAC'` | | | ✔ | ✔ | | | | | | |
+| `'PBKDF2'` | | | | | ✔ | ✔ | | | | |
+| `'RSA-OAEP'` | ✔ | ✔ | | | | | ✔ | ✔ | | |
+| `'RSA-PSS'` | | | ✔ | ✔ | | | | | | |
+| `'RSASSA-PKCS1-v1_5'` | | | ✔ | ✔ | | | | | | |
+| `'NODE-DSA'` <sup>1</sup> | | | ✔ | ✔ | | | | | | |
+| `'NODE-DH'` <sup>1</sup> | | | | | ✔ | ✔ | | | | |
+| `'NODE-SCRYPT'` <sup>1</sup> | | | | | ✔ | ✔ | | | | |
+| `'NODE-ED25519'` <sup>1</sup> | | | ✔ | ✔ | | | | | | |
+| `'NODE-ED448'` <sup>1</sup> | | | ✔ | ✔ | | | | | | |
<sup>1</sup> Node.js-specific extension. | |
@@ -545,8 +566,9 @@ added: v15.0.0 | |
* `baseKey`: {CryptoKey} | |
* `derivedKeyAlgorithm`: {HmacKeyGenParams|AesKeyGenParams} | |
* `extractable`: {boolean} | |
-* `keyUsages`: {string[]} See [Key usages][]. | |
+* `keyUsages`: {string\[]} See [Key usages][]. | |
* Returns: {Promise} containing {CryptoKey} | |
+ | |
<!--lint enable maximum-line-length remark-lint--> | |
Using the method and parameters specified in `algorithm`, and the keying | |
@@ -642,25 +667,25 @@ specification. | |
The special `'node.keyObject'` value for `format` is a Node.js-specific | |
extension that allows converting a {CryptoKey} into a Node.js {KeyObject}. | |
-| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | | |
-| --------------------- | -------- | --------- | ------- | ------- | | |
-| `'AES-CBC'` | | | ✔ | ✔ | | |
-| `'AES-CTR'` | | | ✔ | ✔ | | |
-| `'AES-GCM'` | | | ✔ | ✔ | | |
-| `'AES-KW'` | | | ✔ | ✔ | | |
-| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | |
-| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | |
-| `'HDKF'` | | | | | | |
-| `'HMAC'` | | | ✔ | ✔ | | |
-| `'PBKDF2'` | | | | | | |
-| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | | |
-| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | |
-| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | |
-| `'NODE-DSA'` <sup>1</sup> | ✔ | ✔ | | | | |
-| `'NODE-DH'` <sup>1</sup> | ✔ | ✔ | | | | |
-| `'NODE-SCRYPT'` <sup>1</sup> | | | | | | |
-| `'NODE-ED25519'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
-| `'NODE-ED448'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
+| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | | |
+| ----------------------------- | -------- | --------- | ------- | ------- | | |
+| `'AES-CBC'` | | | ✔ | ✔ | | |
+| `'AES-CTR'` | | | ✔ | ✔ | | |
+| `'AES-GCM'` | | | ✔ | ✔ | | |
+| `'AES-KW'` | | | ✔ | ✔ | | |
+| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | |
+| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | |
+| `'HDKF'` | | | | | | |
+| `'HMAC'` | | | ✔ | ✔ | | |
+| `'PBKDF2'` | | | | | | |
+| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | | |
+| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | |
+| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | |
+| `'NODE-DSA'` <sup>1</sup> | ✔ | ✔ | | | | |
+| `'NODE-DH'` <sup>1</sup> | ✔ | ✔ | | | | |
+| `'NODE-SCRYPT'` <sup>1</sup> | | | | | | |
+| `'NODE-ED25519'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
+| `'NODE-ED448'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
<sup>1</sup> Node.js-specific extension | |
@@ -670,10 +696,13 @@ added: v15.0.0 | |
--> | |
<!--lint disable maximum-line-length remark-lint--> | |
+ | |
* `algorithm`: {RsaHashedKeyGenParams|EcKeyGenParams|HmacKeyGenParams|AesKeyGenParams|NodeDsaKeyGenParams|NodeDhKeyGenParams|NodeEdKeyGenParams} | |
+ | |
<!--lint enable maximum-line-length remark-lint--> | |
+ | |
* `extractable`: {boolean} | |
-* `keyUsages`: {string[]} See [Key usages][]. | |
+* `keyUsages`: {string\[]} See [Key usages][]. | |
* Returns: {Promise} containing {CryptoKey|CryptoKeyPair} | |
Using the method and parameters provided in `algorithm`, `subtle.generateKey()` | |
@@ -715,11 +745,15 @@ changes: | |
* `format`: {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, or | |
`'node.keyObject'`. | |
* `keyData`: {ArrayBuffer|TypedArray|DataView|Buffer|KeyObject} | |
+ | |
<!--lint disable maximum-line-length remark-lint--> | |
+ | |
* `algorithm`: {RsaHashedImportParams|EcKeyImportParams|HmacImportParams|AesImportParams|Pbkdf2ImportParams|NodeDsaImportParams|NodeDhImportParams|NodeScryptImportParams|NodeEdKeyImportParams} | |
+ | |
<!--lint enable maximum-line-length remark-lint--> | |
+ | |
* `extractable`: {boolean} | |
-* `keyUsages`: {string[]} See [Key usages][]. | |
+* `keyUsages`: {string\[]} See [Key usages][]. | |
* Returns: {Promise} containing {CryptoKey} | |
The `subtle.importKey()` method attempts to interpret the provided `keyData` | |
@@ -734,25 +768,25 @@ If importing a `'PBKDF2'` key, `extractable` must be `false`. | |
The algorithms currently supported include: | |
-| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | | |
-| --------------------- | -------- | --------- | ------- | ------- | | |
-| `'AES-CBC'` | | | ✔ | ✔ | | |
-| `'AES-CTR'` | | | ✔ | ✔ | | |
-| `'AES-GCM'` | | | ✔ | ✔ | | |
-| `'AES-KW'` | | | ✔ | ✔ | | |
-| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | |
-| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | |
-| `'HDKF'` | | | | ✔ | | |
-| `'HMAC'` | | | ✔ | ✔ | | |
-| `'PBKDF2'` | | | | ✔ | | |
-| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | | |
-| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | |
-| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | |
-| `'NODE-DSA'` <sup>1</sup> | ✔ | ✔ | | | | |
-| `'NODE-DH'` <sup>1</sup> | ✔ | ✔ | | | | |
-| `'NODE-SCRYPT'` <sup>1</sup> | | | | ✔ | | |
-| `'NODE-ED25519'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
-| `'NODE-ED448'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
+| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | | |
+| ----------------------------- | -------- | --------- | ------- | ------- | | |
+| `'AES-CBC'` | | | ✔ | ✔ | | |
+| `'AES-CTR'` | | | ✔ | ✔ | | |
+| `'AES-GCM'` | | | ✔ | ✔ | | |
+| `'AES-KW'` | | | ✔ | ✔ | | |
+| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | |
+| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | |
+| `'HDKF'` | | | | ✔ | | |
+| `'HMAC'` | | | ✔ | ✔ | | |
+| `'PBKDF2'` | | | | ✔ | | |
+| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | | |
+| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | |
+| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | |
+| `'NODE-DSA'` <sup>1</sup> | ✔ | ✔ | | | | |
+| `'NODE-DH'` <sup>1</sup> | ✔ | ✔ | | | | |
+| `'NODE-SCRYPT'` <sup>1</sup> | | | | ✔ | | |
+| `'NODE-ED25519'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
+| `'NODE-ED448'` <sup>1</sup> | ✔ | ✔ | ✔ | ✔ | | |
<sup>1</sup> Node.js-specific extension | |
@@ -793,12 +831,16 @@ added: v15.0.0 | |
* `format`: {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. | |
* `wrappedKey`: {ArrayBuffer|TypedArray|DataView|Buffer} | |
* `unwrappingKey`: {CryptoKey} | |
+ | |
<!--lint disable maximum-line-length remark-lint--> | |
+ | |
* `unwrapAlgo`: {RsaOaepParams|AesCtrParams|AesCbcParams|AesGcmParams|AesKwParams} | |
* `unwrappedKeyAlgo`: {RsaHashedImportParams|EcKeyImportParams|HmacImportParams|AesImportParams} | |
+ | |
<!--lint enable maximum-line-length remark-lint--> | |
+ | |
* `extractable`: {boolean} | |
-* `keyUsages`: {string[]} See [Key usages][]. | |
+* `keyUsages`: {string\[]} See [Key usages][]. | |
* Returns: {Promise} containing {CryptoKey} | |
In cryptography, "wrapping a key" refers to exporting and then encrypting the | |
diff --git a/doc/api/webstreams.md b/doc/api/webstreams.md | |
index b7b76eb43b..c5e93a3bf1 100644 | |
--- a/doc/api/webstreams.md | |
+++ b/doc/api/webstreams.md | |
@@ -296,7 +306,7 @@ is active. | |
added: v16.5.0 | |
--> | |
-* Returns: {ReadableStream[]} | |
+* Returns: {ReadableStream\[]} | |
Returns a pair of new {ReadableStream} instances to which this | |
`ReadableStream`'s data will be forwarded. Each will receive the | |
@@ -440,7 +458,7 @@ added: v16.5.0 | |
The `ReadableStreamBYOBReader` is an alternative consumer for | |
byte-oriented {ReadableStream}'s (those that are created with | |
`underlyingSource.type` set equal to `'bytes`` when the | |
-`ReadableStream` was created). | |
+`ReadableStream\` was created). | |
The `BYOB` is short for "bring your own buffer". This is a | |
pattern that allows for more efficient reading of byte-oriented | |
@@ -554,7 +576,7 @@ callbacks. These types of `Buffer`s use a shared underlying | |
{ArrayBuffer} object that contains all of the data from all of | |
the pooled `Buffer` instances. When a `Buffer`, {TypedArray}, | |
or {DataView} is passed in to `readableStreamBYOBReader.read()`, | |
-the view's underlying `ArrayBuffer` is *detached*, invalidating | |
+the view's underlying `ArrayBuffer` is _detached_, invalidating | |
all existing views that may exist on that `ArrayBuffer`. This | |
can have disastrous consequences for your application. | |
@@ -746,7 +786,7 @@ added: v16.5.0 | |
the `WritableStream`. | |
* `reason` {any} | |
* Returns: A promise fulfilled with `undefined`. | |
- * `type` {any} The `type` option is reserved for future use and *must* be | |
+ * `type` {any} The `type` option is reserved for future use and _must_ be | |
undefined. | |
* `strategy` {Object} | |
* `highWaterMark` {number} The maximum internal queue size before backpressure | |
@@ -968,9 +1025,9 @@ added: v16.5.0 | |
* `controller` {TransformStreamDefaultController} | |
* Returns: A promise fulfilled with `undefined`. | |
* `readableType` {any} the `readableType` option is reserved for future use | |
- and *must* be `undefined. | |
+ and _must_ be \`undefined. | |
* `writableType` {any} the `writableType` option is reserved for future use | |
- and *must* be `undefined. | |
+ and _must_ be \`undefined. | |
* `writableStrategy` {Object} | |
* `highWaterMark` {number} The maximum internal queue size before backpressure | |
is applied. | |
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md | |
index f9a1d91b45..b349381a06 100644 | |
--- a/doc/api/worker_threads.md | |
+++ b/doc/api/worker_threads.md | |
@@ -372,9 +386,10 @@ added: v15.4.0 | |
--> | |
* `name` {any} The name of the channel to connect to. Any JavaScript value | |
- that can be converted to a string using ``${name}`` is permitted. | |
+ that can be converted to a string using `${name}` is permitted. | |
### `broadcastChannel.close()` | |
+ | |
<!-- YAML | |
added: v15.4.0 | |
--> | |
@@ -410,7 +429,7 @@ added: v15.4.0 | |
--> | |
Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed | |
-BroadcastChannel does *not* let the program exit if it's the only active handle | |
+BroadcastChannel does _not_ let the program exit if it's the only active handle | |
left (the default behavior). If the port is `ref()`ed, calling `ref()` again | |
has no effect. | |
@@ -560,7 +587,7 @@ changes: | |
--> | |
* `value` {any} | |
-* `transferList` {Object[]} | |
+* `transferList` {Object\[]} | |
Sends a JavaScript value to the receiving side of this channel. | |
`value` is transferred in a way which is compatible with | |
@@ -572,7 +599,7 @@ In particular, the significant differences to `JSON` are: | |
* `value` may contain instances of builtin JS types such as `RegExp`s, | |
`BigInt`s, `Map`s, `Set`s, etc. | |
* `value` may contain typed arrays, both using `ArrayBuffer`s | |
- and `SharedArrayBuffer`s. | |
+ and `SharedArrayBuffer`s. | |
* `value` may contain [`WebAssembly.Module`][] instances. | |
* `value` may not contain native (C++-backed) objects other than: | |
* {CryptoKey}s, | |
@@ -736,7 +764,7 @@ added: v10.5.0 | |
--> | |
Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does | |
-*not* let the program exit if it's the only active handle left (the default | |
+_not_ let the program exit if it's the only active handle left (the default | |
behavior). If the port is `ref()`ed, calling `ref()` again has no effect. | |
If listeners are attached or removed using `.on('message')`, the port | |
@@ -894,7 +926,7 @@ changes: | |
If `options.eval` is `true`, this is a string containing JavaScript code | |
rather than a path. | |
* `options` {Object} | |
- * `argv` {any[]} List of arguments which would be stringified and appended to | |
+ * `argv` {any\[]} List of arguments which would be stringified and appended to | |
`process.argv` in the worker. This is mostly similar to the `workerData` | |
but the values are available on the global `process.argv` as if they | |
were passed as CLI options to the script. | |
@@ -906,7 +938,7 @@ changes: | |
* `eval` {boolean} If `true` and the first argument is a `string`, interpret | |
the first argument to the constructor as a script that is executed once the | |
worker is online. | |
- * `execArgv` {string[]} List of node CLI options passed to the worker. | |
+ * `execArgv` {string\[]} List of node CLI options passed to the worker. | |
V8 options (such as `--max-old-space-size`) and options that affect the | |
process (such as `--title`) are not supported. If set, this is provided | |
as [`process.execArgv`][] inside the worker. By default, options are | |
@@ -929,7 +961,7 @@ changes: | |
resources like network sockets or file descriptors managed through | |
the [`FileHandle`][] API. This option is automatically inherited by all | |
nested `Worker`s. **Default:** `true`. | |
- * `transferList` {Object[]} If one or more `MessagePort`-like objects | |
+ * `transferList` {Object\[]} If one or more `MessagePort`-like objects | |
are passed in `workerData`, a `transferList` is required for those | |
items or [`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`][] is thrown. | |
See [`port.postMessage()`][] for more information. | |
@@ -1040,9 +1080,9 @@ added: | |
--> | |
* `utilization1` {Object} The result of a previous call to | |
- `eventLoopUtilization()`. | |
+ `eventLoopUtilization()`. | |
* `utilization2` {Object} The result of a previous call to | |
- `eventLoopUtilization()` prior to `utilization1`. | |
+ `eventLoopUtilization()` prior to `utilization1`. | |
* Returns {Object} | |
* `idle` {number} | |
* `active` {number} | |
@@ -1091,7 +1132,7 @@ added: v10.5.0 | |
--> | |
* `value` {any} | |
-* `transferList` {Object[]} | |
+* `transferList` {Object\[]} | |
Send a message to the worker that is received via | |
[`require('worker_threads').parentPort.on('message')`][]. | |
@@ -1103,7 +1145,7 @@ added: v10.5.0 | |
--> | |
Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does | |
-*not* let the program exit if it's the only active handle left (the default | |
+_not_ let the program exit if it's the only active handle left (the default | |
behavior). If the worker is `ref()`ed, calling `ref()` again has | |
no effect. | |
diff --git a/doc/api/zlib.md b/doc/api/zlib.md | |
index a2ce8fe682..85a0e02efb 100644 | |
--- a/doc/api/zlib.md | |
+++ b/doc/api/zlib.md | |
@@ -430,9 +433,9 @@ The following values are valid flush operations for Brotli-based streams: | |
* `zlib.constants.BROTLI_OPERATION_FINISH` (default for the last chunk) | |
* `zlib.constants.BROTLI_OPERATION_EMIT_METADATA` | |
* This particular operation may be hard to use in a Node.js context, | |
- as the streaming layer makes it hard to know which data will end up | |
- in this frame. Also, there is currently no way to consume this data through | |
- the Node.js API. | |
+ as the streaming layer makes it hard to know which data will end up | |
+ in this frame. Also, there is currently no way to consume this data through | |
+ the Node.js API. | |
#### Compressor options | |
diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js | |
index 64626b71f0..a2738f08e2 100644 | |
--- a/test/parallel/test-process-env-allowed-flags-are-documented.js | |
+++ b/test/parallel/test-process-env-allowed-flags-are-documented.js | |
@@ -15,7 +15,9 @@ const parseSection = (text, startMarker, endMarker) => { | |
const match = text.match(regExp); | |
assert(match, | |
`Unable to locate text between '${startMarker}' and '${endMarker}'.`); | |
- return match[1].split(/\r?\n/); | |
+ return match[1] | |
+ .split(/\r?\n/) | |
+ .filter((val) => val.trim() !== ''); | |
}; | |
const nodeOptionsLines = parseSection(cliText, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment