|
6 | 6 |
|
7 | 7 | Node.js APIs might be deprecated for any of the following reasons: |
8 | 8 |
|
9 | | -* Use of the API is unsafe. |
10 | | -* An improved alternative API is available. |
11 | | -* Breaking changes to the API are expected in a future major release. |
| 9 | +- Use of the API is unsafe. |
| 10 | +- An improved alternative API is available. |
| 11 | +- Breaking changes to the API are expected in a future major release. |
12 | 12 |
|
13 | 13 | Node.js uses four kinds of deprecations: |
14 | 14 |
|
15 | | -* Documentation-only |
16 | | -* Application (non-`node_modules` code only) |
17 | | -* Runtime (all code) |
18 | | -* End-of-Life |
| 15 | +- Documentation-only |
| 16 | +- Application (non-`node_modules` code only) |
| 17 | +- Runtime (all code) |
| 18 | +- End-of-Life |
19 | 19 |
|
20 | 20 | A Documentation-only deprecation is one that is expressed only within the |
21 | 21 | Node.js API docs. These generate no side-effects while running Node.js. |
@@ -156,17 +156,17 @@ API usability issues that can lead to accidental security issues. |
156 | 156 | As an alternative, use one of the following methods of constructing `Buffer` |
157 | 157 | objects: |
158 | 158 |
|
159 | | -* [`Buffer.alloc(size[, fill[, encoding]])`][alloc]: Create a `Buffer` with |
| 159 | +- [`Buffer.alloc(size[, fill[, encoding]])`][alloc]: Create a `Buffer` with |
160 | 160 | _initialized_ memory. |
161 | | -* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size]: Create a `Buffer` with |
| 161 | +- [`Buffer.allocUnsafe(size)`][alloc_unsafe_size]: Create a `Buffer` with |
162 | 162 | _uninitialized_ memory. |
163 | | -* [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with _uninitialized_ |
| 163 | +- [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with _uninitialized_ |
164 | 164 | memory. |
165 | | -* [`Buffer.from(array)`][]: Create a `Buffer` with a copy of `array` |
166 | | -* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] - |
| 165 | +- [`Buffer.from(array)`][]: Create a `Buffer` with a copy of `array` |
| 166 | +- [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] - |
167 | 167 | Create a `Buffer` that wraps the given `arrayBuffer`. |
168 | | -* [`Buffer.from(buffer)`][]: Create a `Buffer` that copies `buffer`. |
169 | | -* [`Buffer.from(string[, encoding])`][from_string_encoding]: Create a `Buffer` |
| 168 | +- [`Buffer.from(buffer)`][]: Create a `Buffer` that copies `buffer`. |
| 169 | +- [`Buffer.from(string[, encoding])`][from_string_encoding]: Create a `Buffer` |
170 | 170 | that copies `string`. |
171 | 171 |
|
172 | 172 | Without `--pending-deprecation`, runtime warnings occur only for code not in |
@@ -940,7 +940,7 @@ changes: |
940 | 940 |
|
941 | 941 | Type: End-of-Life |
942 | 942 |
|
943 | | -The [`tls.CryptoStream`][] class was removed. Please use |
| 943 | +The `tls.CryptoStream` class was removed. Please use |
944 | 944 | [`tls.TLSSocket`][] instead. |
945 | 945 |
|
946 | 946 | ### DEP0043: `tls.SecurePair` |
@@ -1402,9 +1402,9 @@ The `util.log()` API has been removed because it's an unmaintained |
1402 | 1402 | legacy API that was exposed to user land by accident. Instead, |
1403 | 1403 | consider the following alternatives based on your specific needs: |
1404 | 1404 |
|
1405 | | -* **Third-Party Logging Libraries** |
| 1405 | +- **Third-Party Logging Libraries** |
1406 | 1406 |
|
1407 | | -* **Use `console.log(new Date().toLocaleString(), message)`** |
| 1407 | +- **Use `console.log(new Date().toLocaleString(), message)`** |
1408 | 1408 |
|
1409 | 1409 | By adopting one of these alternatives, you can transition away from `util.log()` |
1410 | 1410 | and choose a logging strategy that aligns with the specific |
@@ -1897,19 +1897,19 @@ Since Node.js versions 4.4.0 and 5.2.0, several modules only intended for |
1897 | 1897 | internal usage were mistakenly exposed to user code through `require()`. These |
1898 | 1898 | modules were: |
1899 | 1899 |
|
1900 | | -* `v8/tools/codemap` |
1901 | | -* `v8/tools/consarray` |
1902 | | -* `v8/tools/csvparser` |
1903 | | -* `v8/tools/logreader` |
1904 | | -* `v8/tools/profile_view` |
1905 | | -* `v8/tools/profile` |
1906 | | -* `v8/tools/SourceMap` |
1907 | | -* `v8/tools/splaytree` |
1908 | | -* `v8/tools/tickprocessor-driver` |
1909 | | -* `v8/tools/tickprocessor` |
1910 | | -* `node-inspect/lib/_inspect` (from 7.6.0) |
1911 | | -* `node-inspect/lib/internal/inspect_client` (from 7.6.0) |
1912 | | -* `node-inspect/lib/internal/inspect_repl` (from 7.6.0) |
| 1900 | +- `v8/tools/codemap` |
| 1901 | +- `v8/tools/consarray` |
| 1902 | +- `v8/tools/csvparser` |
| 1903 | +- `v8/tools/logreader` |
| 1904 | +- `v8/tools/profile_view` |
| 1905 | +- `v8/tools/profile` |
| 1906 | +- `v8/tools/SourceMap` |
| 1907 | +- `v8/tools/splaytree` |
| 1908 | +- `v8/tools/tickprocessor-driver` |
| 1909 | +- `v8/tools/tickprocessor` |
| 1910 | +- `node-inspect/lib/_inspect` (from 7.6.0) |
| 1911 | +- `node-inspect/lib/internal/inspect_client` (from 7.6.0) |
| 1912 | +- `node-inspect/lib/internal/inspect_repl` (from 7.6.0) |
1913 | 1913 |
|
1914 | 1914 | The `v8/*` modules do not have any exports, and if not imported in a specific |
1915 | 1915 | order would in fact throw errors. As such there are virtually no legitimate use |
@@ -2849,8 +2849,7 @@ async function openAndClose() { |
2849 | 2849 | try { |
2850 | 2850 | filehandle = await fsPromises.open('thefile.txt', 'r'); |
2851 | 2851 | } finally { |
2852 | | - if (filehandle !== undefined) |
2853 | | - await filehandle.close(); |
| 2852 | + if (filehandle !== undefined) await filehandle.close(); |
2854 | 2853 | } |
2855 | 2854 | } |
2856 | 2855 | ``` |
@@ -2982,8 +2981,9 @@ When looking for the CommonJS modules that have required the current one, |
2982 | 2981 | `require.cache` and `module.children` can be used: |
2983 | 2982 |
|
2984 | 2983 | ```js |
2985 | | -const moduleParents = Object.values(require.cache) |
2986 | | - .filter((m) => m.children.includes(module)); |
| 2984 | +const moduleParents = Object.values(require.cache).filter((m) => |
| 2985 | + m.children.includes(module) |
| 2986 | +); |
2987 | 2987 | ``` |
2988 | 2988 |
|
2989 | 2989 | ### DEP0145: `socket.bufferSize` |
@@ -3985,7 +3985,6 @@ When an `args` array is passed to [`child_process.execFile`][] or [`child_proces |
3985 | 3985 | [`timeout.ref()`]: timers.md#timeoutref |
3986 | 3986 | [`timeout.refresh()`]: timers.md#timeoutrefresh |
3987 | 3987 | [`timeout.unref()`]: timers.md#timeoutunref |
3988 | | -[`tls.CryptoStream`]: tls.md#class-tlscryptostream |
3989 | 3988 | [`tls.SecureContext`]: tls.md#tlscreatesecurecontextoptions |
3990 | 3989 | [`tls.TLSSocket`]: tls.md#class-tlstlssocket |
3991 | 3990 | [`tls.checkServerIdentity()`]: tls.md#tlscheckserveridentityhostname-cert |
|
0 commit comments