@types/node 20.2.6 → 20.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Sat, 10 Jun 2023 02:02:52 GMT
11
+ * Last updated: Tue, 13 Jun 2023 02:32:48 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/buffer.d.ts CHANGED
@@ -299,6 +299,10 @@ declare module 'buffer' {
299
299
  * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
300
300
  * ```
301
301
  *
302
+ * If `array` is an `Array`\-like object (that is, one with a `length` property of
303
+ * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
304
+ * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
305
+ *
302
306
  * A `TypeError` will be thrown if `array` is not an `Array` or another type
303
307
  * appropriate for `Buffer.from()` variants.
304
308
  *
@@ -550,9 +554,8 @@ declare module 'buffer' {
550
554
  * A `TypeError` will be thrown if `size` is not a number.
551
555
  *
552
556
  * The `Buffer` module pre-allocates an internal `Buffer` instance of
553
- * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the
554
- * deprecated`new Buffer(size)` constructor only when `size` is less than or equal
555
- * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
557
+ * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
558
+ * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
556
559
  *
557
560
  * Use of this pre-allocated internal memory pool is a key difference between
558
561
  * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
node/cluster.d.ts CHANGED
@@ -67,6 +67,8 @@ declare module 'cluster' {
67
67
  gid?: number | undefined;
68
68
  inspectPort?: number | (() => number) | undefined;
69
69
  serialization?: SerializationType | undefined;
70
+ cwd?: string | undefined;
71
+ windowsHide?: boolean | undefined;
70
72
  }
71
73
  export interface Address {
72
74
  address: string;
node/crypto.d.ts CHANGED
@@ -21,14 +21,14 @@ declare module 'crypto' {
21
21
  import { PeerCertificate } from 'node:tls';
22
22
  /**
23
23
  * SPKAC is a Certificate Signing Request mechanism originally implemented by
24
- * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
24
+ * Netscape and was specified formally as part of HTML5's `keygen` element.
25
25
  *
26
26
  * `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
27
27
  * should not use this element anymore.
28
28
  *
29
29
  * The `node:crypto` module provides the `Certificate` class for working with SPKAC
30
30
  * data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
31
- * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
31
+ * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally.
32
32
  * @since v0.11.8
33
33
  */
34
34
  class Certificate {
@@ -223,7 +223,9 @@ declare module 'crypto' {
223
223
  * display the available digest algorithms.
224
224
  *
225
225
  * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
226
- * a `KeyObject`, its type must be `secret`.
226
+ * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was
227
+ * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not
228
+ * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256).
227
229
  *
228
230
  * Example: generating the sha256 HMAC of a file
229
231
  *
@@ -683,13 +685,13 @@ declare module 'crypto' {
683
685
  * **GCM, or CCM).**
684
686
  *
685
687
  * The implementation of `crypto.createCipher()` derives keys using the OpenSSL
686
- * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
688
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
687
689
  * iteration, and no salt. The lack of salt allows dictionary attacks as the same
688
690
  * password always creates the same key. The low iteration count and
689
691
  * non-cryptographically secure hash algorithm allow passwords to be tested very
690
692
  * rapidly.
691
693
  *
692
- * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
694
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that
693
695
  * developers derive a key and IV on
694
696
  * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode
695
697
  * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
@@ -944,13 +946,13 @@ declare module 'crypto' {
944
946
  * **GCM, or CCM).**
945
947
  *
946
948
  * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
947
- * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
949
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
948
950
  * iteration, and no salt. The lack of salt allows dictionary attacks as the same
949
951
  * password always creates the same key. The low iteration count and
950
952
  * non-cryptographically secure hash algorithm allow passwords to be tested very
951
953
  * rapidly.
952
954
  *
953
- * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
955
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that
954
956
  * developers derive a key and IV on
955
957
  * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object.
956
958
  * @since v0.1.94
@@ -1195,11 +1197,14 @@ declare module 'crypto' {
1195
1197
  * generateKey,
1196
1198
  * } = await import('node:crypto');
1197
1199
  *
1198
- * generateKey('hmac', { length: 64 }, (err, key) => {
1200
+ * generateKey('hmac', { length: 512 }, (err, key) => {
1199
1201
  * if (err) throw err;
1200
1202
  * console.log(key.export().toString('hex')); // 46e..........620
1201
1203
  * });
1202
1204
  * ```
1205
+ *
1206
+ * The size of a generated HMAC key should not exceed the block size of the
1207
+ * underlying hash function. See {@link createHmac} for more information.
1203
1208
  * @since v15.0.0
1204
1209
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1205
1210
  */
@@ -1218,9 +1223,12 @@ declare module 'crypto' {
1218
1223
  * generateKeySync,
1219
1224
  * } = await import('node:crypto');
1220
1225
  *
1221
- * const key = generateKeySync('hmac', { length: 64 });
1226
+ * const key = generateKeySync('hmac', { length: 512 });
1222
1227
  * console.log(key.export().toString('hex')); // e89..........41e
1223
1228
  * ```
1229
+ *
1230
+ * The size of a generated HMAC key should not exceed the block size of the
1231
+ * underlying hash function. See {@link createHmac} for more information.
1224
1232
  * @since v15.0.0
1225
1233
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1226
1234
  */
node/fs.d.ts CHANGED
@@ -1632,18 +1632,19 @@ declare module 'fs' {
1632
1632
  *
1633
1633
  * The callback is given a possible exception and, if `recursive` is `true`, the
1634
1634
  * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
1635
- * created.
1635
+ * created (for instance, if it was previously created).
1636
1636
  *
1637
1637
  * The optional `options` argument can be an integer specifying `mode` (permission
1638
1638
  * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that
1639
1639
  * exists results in an error only
1640
- * when `recursive` is false.
1640
+ * when `recursive` is false. If `recursive` is false and the directory exists,
1641
+ * an `EEXIST` error occurs.
1641
1642
  *
1642
1643
  * ```js
1643
1644
  * import { mkdir } from 'node:fs';
1644
1645
  *
1645
- * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist.
1646
- * mkdir('/tmp/a/apple', { recursive: true }, (err) => {
1646
+ * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist.
1647
+ * mkdir('./tmp/a/apple', { recursive: true }, (err) => {
1647
1648
  * if (err) throw err;
1648
1649
  * });
1649
1650
  * ```
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 20.2
1
+ // Type definitions for non-npm package Node.js 20.3
2
2
  // Project: https://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/net.d.ts CHANGED
@@ -310,12 +310,14 @@ declare module 'net' {
310
310
  */
311
311
  readonly remoteAddress?: string | undefined;
312
312
  /**
313
- * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`.
313
+ * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
314
+ * the socket is destroyed (for example, if the client disconnected).
314
315
  * @since v0.11.14
315
316
  */
316
317
  readonly remoteFamily?: string | undefined;
317
318
  /**
318
- * The numeric representation of the remote port. For example, `80` or `21`.
319
+ * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
320
+ * the socket is destroyed (for example, if the client disconnected).
319
321
  * @since v0.5.10
320
322
  */
321
323
  readonly remotePort?: number | undefined;
@@ -744,8 +746,8 @@ declare module 'net' {
744
746
  *
745
747
  * Test this by using `telnet`:
746
748
  *
747
- * ```console
748
- * $ telnet localhost 8124
749
+ * ```bash
750
+ * telnet localhost 8124
749
751
  * ```
750
752
  *
751
753
  * To listen on the socket `/tmp/echo.sock`:
@@ -758,8 +760,8 @@ declare module 'net' {
758
760
  *
759
761
  * Use `nc` to connect to a Unix domain socket server:
760
762
  *
761
- * ```console
762
- * $ nc -U /tmp/echo.sock
763
+ * ```bash
764
+ * nc -U /tmp/echo.sock
763
765
  * ```
764
766
  * @since v0.5.0
765
767
  * @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.2.6",
3
+ "version": "20.3.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "6564d8b4fd53b40adc2b69356c593a80fe9a2215e3d259e0e08a02c3621912e8",
235
+ "typesPublisherContentHash": "c47aade88cd1332fb7e20ae32636fbd2941ea3e16db2c41f81bc1509e6e8c41f",
236
236
  "typeScriptVersion": "4.3"
237
237
  }
node/process.d.ts CHANGED
@@ -307,8 +307,8 @@ declare module 'process' {
307
307
  *
308
308
  * Launching the Node.js process as:
309
309
  *
310
- * ```console
311
- * $ node process-args.js one two=three four
310
+ * ```bash
311
+ * node process-args.js one two=three four
312
312
  * ```
313
313
  *
314
314
  * Would generate the output:
@@ -344,8 +344,8 @@ declare module 'process' {
344
344
  * the script name. These options are useful in order to spawn child processes with
345
345
  * the same execution environment as the parent.
346
346
  *
347
- * ```console
348
- * $ node --harmony script.js --version
347
+ * ```bash
348
+ * node --harmony script.js --version
349
349
  * ```
350
350
  *
351
351
  * Results in `process.execArgv`:
@@ -492,8 +492,8 @@ declare module 'process' {
492
492
  * to other `Worker` threads.
493
493
  * In other words, the following example would not work:
494
494
  *
495
- * ```console
496
- * $ node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
495
+ * ```bash
496
+ * node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
497
497
  * ```
498
498
  *
499
499
  * While the following will:
@@ -898,21 +898,30 @@ declare module 'process' {
898
898
  * Will generate an object similar to:
899
899
  *
900
900
  * ```console
901
- * { node: '11.13.0',
902
- * v8: '7.0.276.38-node.18',
903
- * uv: '1.27.0',
904
- * zlib: '1.2.11',
905
- * brotli: '1.0.7',
906
- * ares: '1.15.0',
907
- * modules: '67',
908
- * nghttp2: '1.34.0',
909
- * napi: '4',
910
- * llhttp: '1.1.1',
911
- * openssl: '1.1.1b',
912
- * cldr: '34.0',
913
- * icu: '63.1',
914
- * tz: '2018e',
915
- * unicode: '11.0' }
901
+ * { node: '20.2.0',
902
+ * acorn: '8.8.2',
903
+ * ada: '2.4.0',
904
+ * ares: '1.19.0',
905
+ * base64: '0.5.0',
906
+ * brotli: '1.0.9',
907
+ * cjs_module_lexer: '1.2.2',
908
+ * cldr: '43.0',
909
+ * icu: '73.1',
910
+ * llhttp: '8.1.0',
911
+ * modules: '115',
912
+ * napi: '8',
913
+ * nghttp2: '1.52.0',
914
+ * nghttp3: '0.7.0',
915
+ * ngtcp2: '0.8.1',
916
+ * openssl: '3.0.8+quic',
917
+ * simdutf: '3.2.9',
918
+ * tz: '2023c',
919
+ * undici: '5.22.0',
920
+ * unicode: '15.0',
921
+ * uv: '1.44.2',
922
+ * uvwasi: '0.0.16',
923
+ * v8: '11.3.244.8-node.9',
924
+ * zlib: '1.2.13' }
916
925
  * ```
917
926
  * @since v0.2.0
918
927
  */
node/ts4.8/buffer.d.ts CHANGED
@@ -299,6 +299,10 @@ declare module 'buffer' {
299
299
  * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
300
300
  * ```
301
301
  *
302
+ * If `array` is an `Array`\-like object (that is, one with a `length` property of
303
+ * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
304
+ * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
305
+ *
302
306
  * A `TypeError` will be thrown if `array` is not an `Array` or another type
303
307
  * appropriate for `Buffer.from()` variants.
304
308
  *
@@ -550,9 +554,8 @@ declare module 'buffer' {
550
554
  * A `TypeError` will be thrown if `size` is not a number.
551
555
  *
552
556
  * The `Buffer` module pre-allocates an internal `Buffer` instance of
553
- * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the
554
- * deprecated`new Buffer(size)` constructor only when `size` is less than or equal
555
- * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
557
+ * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
558
+ * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
556
559
  *
557
560
  * Use of this pre-allocated internal memory pool is a key difference between
558
561
  * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
node/ts4.8/cluster.d.ts CHANGED
@@ -67,6 +67,8 @@ declare module 'cluster' {
67
67
  gid?: number | undefined;
68
68
  inspectPort?: number | (() => number) | undefined;
69
69
  serialization?: SerializationType | undefined;
70
+ cwd?: string | undefined;
71
+ windowsHide?: boolean | undefined;
70
72
  }
71
73
  export interface Address {
72
74
  address: string;
node/ts4.8/crypto.d.ts CHANGED
@@ -21,14 +21,14 @@ declare module 'crypto' {
21
21
  import { PeerCertificate } from 'node:tls';
22
22
  /**
23
23
  * SPKAC is a Certificate Signing Request mechanism originally implemented by
24
- * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
24
+ * Netscape and was specified formally as part of HTML5's `keygen` element.
25
25
  *
26
26
  * `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
27
27
  * should not use this element anymore.
28
28
  *
29
29
  * The `node:crypto` module provides the `Certificate` class for working with SPKAC
30
30
  * data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
31
- * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
31
+ * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally.
32
32
  * @since v0.11.8
33
33
  */
34
34
  class Certificate {
@@ -223,7 +223,9 @@ declare module 'crypto' {
223
223
  * display the available digest algorithms.
224
224
  *
225
225
  * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
226
- * a `KeyObject`, its type must be `secret`.
226
+ * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was
227
+ * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not
228
+ * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256).
227
229
  *
228
230
  * Example: generating the sha256 HMAC of a file
229
231
  *
@@ -683,13 +685,13 @@ declare module 'crypto' {
683
685
  * **GCM, or CCM).**
684
686
  *
685
687
  * The implementation of `crypto.createCipher()` derives keys using the OpenSSL
686
- * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
688
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
687
689
  * iteration, and no salt. The lack of salt allows dictionary attacks as the same
688
690
  * password always creates the same key. The low iteration count and
689
691
  * non-cryptographically secure hash algorithm allow passwords to be tested very
690
692
  * rapidly.
691
693
  *
692
- * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
694
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that
693
695
  * developers derive a key and IV on
694
696
  * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode
695
697
  * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
@@ -944,13 +946,13 @@ declare module 'crypto' {
944
946
  * **GCM, or CCM).**
945
947
  *
946
948
  * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
947
- * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
949
+ * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
948
950
  * iteration, and no salt. The lack of salt allows dictionary attacks as the same
949
951
  * password always creates the same key. The low iteration count and
950
952
  * non-cryptographically secure hash algorithm allow passwords to be tested very
951
953
  * rapidly.
952
954
  *
953
- * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
955
+ * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that
954
956
  * developers derive a key and IV on
955
957
  * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object.
956
958
  * @since v0.1.94
@@ -1195,11 +1197,14 @@ declare module 'crypto' {
1195
1197
  * generateKey,
1196
1198
  * } = await import('node:crypto');
1197
1199
  *
1198
- * generateKey('hmac', { length: 64 }, (err, key) => {
1200
+ * generateKey('hmac', { length: 512 }, (err, key) => {
1199
1201
  * if (err) throw err;
1200
1202
  * console.log(key.export().toString('hex')); // 46e..........620
1201
1203
  * });
1202
1204
  * ```
1205
+ *
1206
+ * The size of a generated HMAC key should not exceed the block size of the
1207
+ * underlying hash function. See {@link createHmac} for more information.
1203
1208
  * @since v15.0.0
1204
1209
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1205
1210
  */
@@ -1218,9 +1223,12 @@ declare module 'crypto' {
1218
1223
  * generateKeySync,
1219
1224
  * } = await import('node:crypto');
1220
1225
  *
1221
- * const key = generateKeySync('hmac', { length: 64 });
1226
+ * const key = generateKeySync('hmac', { length: 512 });
1222
1227
  * console.log(key.export().toString('hex')); // e89..........41e
1223
1228
  * ```
1229
+ *
1230
+ * The size of a generated HMAC key should not exceed the block size of the
1231
+ * underlying hash function. See {@link createHmac} for more information.
1224
1232
  * @since v15.0.0
1225
1233
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1226
1234
  */
node/ts4.8/fs.d.ts CHANGED
@@ -1632,18 +1632,19 @@ declare module 'fs' {
1632
1632
  *
1633
1633
  * The callback is given a possible exception and, if `recursive` is `true`, the
1634
1634
  * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
1635
- * created.
1635
+ * created (for instance, if it was previously created).
1636
1636
  *
1637
1637
  * The optional `options` argument can be an integer specifying `mode` (permission
1638
1638
  * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that
1639
1639
  * exists results in an error only
1640
- * when `recursive` is false.
1640
+ * when `recursive` is false. If `recursive` is false and the directory exists,
1641
+ * an `EEXIST` error occurs.
1641
1642
  *
1642
1643
  * ```js
1643
1644
  * import { mkdir } from 'node:fs';
1644
1645
  *
1645
- * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist.
1646
- * mkdir('/tmp/a/apple', { recursive: true }, (err) => {
1646
+ * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist.
1647
+ * mkdir('./tmp/a/apple', { recursive: true }, (err) => {
1647
1648
  * if (err) throw err;
1648
1649
  * });
1649
1650
  * ```
node/ts4.8/net.d.ts CHANGED
@@ -310,12 +310,14 @@ declare module 'net' {
310
310
  */
311
311
  readonly remoteAddress?: string | undefined;
312
312
  /**
313
- * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`.
313
+ * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
314
+ * the socket is destroyed (for example, if the client disconnected).
314
315
  * @since v0.11.14
315
316
  */
316
317
  readonly remoteFamily?: string | undefined;
317
318
  /**
318
- * The numeric representation of the remote port. For example, `80` or `21`.
319
+ * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
320
+ * the socket is destroyed (for example, if the client disconnected).
319
321
  * @since v0.5.10
320
322
  */
321
323
  readonly remotePort?: number | undefined;
@@ -744,8 +746,8 @@ declare module 'net' {
744
746
  *
745
747
  * Test this by using `telnet`:
746
748
  *
747
- * ```console
748
- * $ telnet localhost 8124
749
+ * ```bash
750
+ * telnet localhost 8124
749
751
  * ```
750
752
  *
751
753
  * To listen on the socket `/tmp/echo.sock`:
@@ -758,8 +760,8 @@ declare module 'net' {
758
760
  *
759
761
  * Use `nc` to connect to a Unix domain socket server:
760
762
  *
761
- * ```console
762
- * $ nc -U /tmp/echo.sock
763
+ * ```bash
764
+ * nc -U /tmp/echo.sock
763
765
  * ```
764
766
  * @since v0.5.0
765
767
  * @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
node/ts4.8/process.d.ts CHANGED
@@ -307,8 +307,8 @@ declare module 'process' {
307
307
  *
308
308
  * Launching the Node.js process as:
309
309
  *
310
- * ```console
311
- * $ node process-args.js one two=three four
310
+ * ```bash
311
+ * node process-args.js one two=three four
312
312
  * ```
313
313
  *
314
314
  * Would generate the output:
@@ -344,8 +344,8 @@ declare module 'process' {
344
344
  * the script name. These options are useful in order to spawn child processes with
345
345
  * the same execution environment as the parent.
346
346
  *
347
- * ```console
348
- * $ node --harmony script.js --version
347
+ * ```bash
348
+ * node --harmony script.js --version
349
349
  * ```
350
350
  *
351
351
  * Results in `process.execArgv`:
@@ -492,8 +492,8 @@ declare module 'process' {
492
492
  * to other `Worker` threads.
493
493
  * In other words, the following example would not work:
494
494
  *
495
- * ```console
496
- * $ node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
495
+ * ```bash
496
+ * node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
497
497
  * ```
498
498
  *
499
499
  * While the following will:
@@ -898,21 +898,30 @@ declare module 'process' {
898
898
  * Will generate an object similar to:
899
899
  *
900
900
  * ```console
901
- * { node: '11.13.0',
902
- * v8: '7.0.276.38-node.18',
903
- * uv: '1.27.0',
904
- * zlib: '1.2.11',
905
- * brotli: '1.0.7',
906
- * ares: '1.15.0',
907
- * modules: '67',
908
- * nghttp2: '1.34.0',
909
- * napi: '4',
910
- * llhttp: '1.1.1',
911
- * openssl: '1.1.1b',
912
- * cldr: '34.0',
913
- * icu: '63.1',
914
- * tz: '2018e',
915
- * unicode: '11.0' }
901
+ * { node: '20.2.0',
902
+ * acorn: '8.8.2',
903
+ * ada: '2.4.0',
904
+ * ares: '1.19.0',
905
+ * base64: '0.5.0',
906
+ * brotli: '1.0.9',
907
+ * cjs_module_lexer: '1.2.2',
908
+ * cldr: '43.0',
909
+ * icu: '73.1',
910
+ * llhttp: '8.1.0',
911
+ * modules: '115',
912
+ * napi: '8',
913
+ * nghttp2: '1.52.0',
914
+ * nghttp3: '0.7.0',
915
+ * ngtcp2: '0.8.1',
916
+ * openssl: '3.0.8+quic',
917
+ * simdutf: '3.2.9',
918
+ * tz: '2023c',
919
+ * undici: '5.22.0',
920
+ * unicode: '15.0',
921
+ * uv: '1.44.2',
922
+ * uvwasi: '0.0.16',
923
+ * v8: '11.3.244.8-node.9',
924
+ * zlib: '1.2.13' }
916
925
  * ```
917
926
  * @since v0.2.0
918
927
  */
node/ts4.8/tty.d.ts CHANGED
@@ -42,7 +42,10 @@ declare module 'tty' {
42
42
  constructor(fd: number, options?: net.SocketConstructorOpts);
43
43
  /**
44
44
  * A `boolean` that is `true` if the TTY is currently configured to operate as a
45
- * raw device. Defaults to `false`.
45
+ * raw device.
46
+ *
47
+ * This flag is always `false` when a process starts, even if the terminal is
48
+ * operating in raw mode. Its value will change with subsequent calls to`setRawMode`.
46
49
  * @since v0.7.7
47
50
  */
48
51
  isRaw: boolean;
node/ts4.8/wasi.d.ts CHANGED
@@ -58,8 +58,8 @@
58
58
  *
59
59
  * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
60
60
  *
61
- * ```console
62
- * $ wat2wasm demo.wat
61
+ * ```bash
62
+ * wat2wasm demo.wat
63
63
  * ```
64
64
  * @experimental
65
65
  * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/wasi.js)
node/tty.d.ts CHANGED
@@ -42,7 +42,10 @@ declare module 'tty' {
42
42
  constructor(fd: number, options?: net.SocketConstructorOpts);
43
43
  /**
44
44
  * A `boolean` that is `true` if the TTY is currently configured to operate as a
45
- * raw device. Defaults to `false`.
45
+ * raw device.
46
+ *
47
+ * This flag is always `false` when a process starts, even if the terminal is
48
+ * operating in raw mode. Its value will change with subsequent calls to`setRawMode`.
46
49
  * @since v0.7.7
47
50
  */
48
51
  isRaw: boolean;
node/wasi.d.ts CHANGED
@@ -58,8 +58,8 @@
58
58
  *
59
59
  * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
60
60
  *
61
- * ```console
62
- * $ wat2wasm demo.wat
61
+ * ```bash
62
+ * wat2wasm demo.wat
63
63
  * ```
64
64
  * @experimental
65
65
  * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/wasi.js)