@types/node 20.16.7 → 20.16.9

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 v20.16/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 25 Sep 2024 00:29:50 GMT
11
+ * Last updated: Wed, 25 Sep 2024 22:07:42 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node v20.16/buffer.d.ts CHANGED
@@ -134,7 +134,7 @@ declare module "buffer" {
134
134
  export interface BlobOptions {
135
135
  /**
136
136
  * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
137
- * will be converted to the platform native line-ending as specified by `require('node:os').EOL`.
137
+ * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:node:os'`.
138
138
  */
139
139
  endings?: "transparent" | "native";
140
140
  /**
@@ -211,7 +211,7 @@ declare module "buffer" {
211
211
  export interface FileOptions {
212
212
  /**
213
213
  * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
214
- * converted to the platform native line-ending as specified by `require('node:os').EOL`.
214
+ * converted to the platform native line-ending as specified by `import { EOL } from 'node:node:os'`.
215
215
  */
216
216
  endings?: "native" | "transparent";
217
217
  /** The File content-type. */
@@ -262,6 +262,13 @@ declare module "buffer" {
262
262
  | {
263
263
  valueOf(): T;
264
264
  };
265
+ // `WithArrayBufferLike` is a backwards-compatible workaround for the addition of a `TArrayBuffer` type parameter to
266
+ // `Uint8Array` to ensure that `Buffer` remains assignment-compatible with `Uint8Array`, but without the added
267
+ // complexity involved with making `Buffer` itself generic as that would require re-introducing `"typesVersions"` to
268
+ // the NodeJS types. It is likely this interface will become deprecated in the future once `Buffer` does become generic.
269
+ interface WithArrayBufferLike<TArrayBuffer extends ArrayBufferLike> {
270
+ readonly buffer: TArrayBuffer;
271
+ }
265
272
  /**
266
273
  * Raw data is stored in instances of the Buffer class.
267
274
  * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
@@ -913,7 +920,7 @@ declare module "buffer" {
913
920
  * @param [start=0] Where the new `Buffer` will start.
914
921
  * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
915
922
  */
916
- slice(start?: number, end?: number): Buffer;
923
+ slice(start?: number, end?: number): Buffer & WithArrayBufferLike<this["buffer"]>;
917
924
  /**
918
925
  * Returns a new `Buffer` that references the same memory as the original, but
919
926
  * offset and cropped by the `start` and `end` indices.
@@ -973,7 +980,7 @@ declare module "buffer" {
973
980
  * @param [start=0] Where the new `Buffer` will start.
974
981
  * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
975
982
  */
976
- subarray(start?: number, end?: number): Buffer;
983
+ subarray(start?: number, end?: number): Buffer & WithArrayBufferLike<this["buffer"]>;
977
984
  /**
978
985
  * Writes `value` to `buf` at the specified `offset` as big-endian.
979
986
  *
@@ -1631,7 +1638,7 @@ declare module "buffer" {
1631
1638
  * @since v5.10.0
1632
1639
  * @return A reference to `buf`.
1633
1640
  */
1634
- swap16(): Buffer;
1641
+ swap16(): this;
1635
1642
  /**
1636
1643
  * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
1637
1644
  * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
@@ -1657,7 +1664,7 @@ declare module "buffer" {
1657
1664
  * @since v5.10.0
1658
1665
  * @return A reference to `buf`.
1659
1666
  */
1660
- swap32(): Buffer;
1667
+ swap32(): this;
1661
1668
  /**
1662
1669
  * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
1663
1670
  * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
@@ -1683,7 +1690,7 @@ declare module "buffer" {
1683
1690
  * @since v6.3.0
1684
1691
  * @return A reference to `buf`.
1685
1692
  */
1686
- swap64(): Buffer;
1693
+ swap64(): this;
1687
1694
  /**
1688
1695
  * Writes `value` to `buf` at the specified `offset`. `value` must be a
1689
1696
  * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
@@ -2280,7 +2287,7 @@ declare module "buffer" {
2280
2287
  function btoa(data: string): string;
2281
2288
  interface Blob extends _Blob {}
2282
2289
  /**
2283
- * `Blob` class is a global reference for `require('node:buffer').Blob`
2290
+ * `Blob` class is a global reference for `import { Blob } from 'node:node:buffer'`
2284
2291
  * https://nodejs.org/api/buffer.html#class-blob
2285
2292
  * @since v18.0.0
2286
2293
  */
@@ -2288,7 +2295,7 @@ declare module "buffer" {
2288
2295
  : typeof import("buffer").Blob;
2289
2296
  interface File extends _File {}
2290
2297
  /**
2291
- * `File` class is a global reference for `require('node:buffer').File`
2298
+ * `File` class is a global reference for `import { File } from 'node:node:buffer'`
2292
2299
  * https://nodejs.org/api/buffer.html#class-file
2293
2300
  * @since v20.0.0
2294
2301
  */
@@ -4,7 +4,7 @@
4
4
  * is primarily provided by the {@link spawn} function:
5
5
  *
6
6
  * ```js
7
- * const { spawn } = require('node:child_process');
7
+ * import { spawn } from 'node:child_process';
8
8
  * const ls = spawn('ls', ['-lh', '/usr']);
9
9
  *
10
10
  * ls.stdout.on('data', (data) => {
@@ -109,7 +109,7 @@ declare module "child_process" {
109
109
  * refer to the same value.
110
110
  *
111
111
  * ```js
112
- * const { spawn } = require('node:child_process');
112
+ * import { spawn } from 'node:child_process';
113
113
  *
114
114
  * const subprocess = spawn('ls');
115
115
  *
@@ -152,9 +152,9 @@ declare module "child_process" {
152
152
  * in the array are `null`.
153
153
  *
154
154
  * ```js
155
- * const assert = require('node:assert');
156
- * const fs = require('node:fs');
157
- * const child_process = require('node:child_process');
155
+ * import assert from 'node:assert';
156
+ * import fs from 'node:fs';
157
+ * import child_process from 'node:child_process';
158
158
  *
159
159
  * const subprocess = child_process.spawn('ls', {
160
160
  * stdio: [
@@ -202,7 +202,7 @@ declare module "child_process" {
202
202
  * emitted.
203
203
  *
204
204
  * ```js
205
- * const { spawn } = require('node:child_process');
205
+ * import { spawn } from 'node:child_process';
206
206
  * const grep = spawn('grep', ['ssh']);
207
207
  *
208
208
  * console.log(`Spawned child pid: ${grep.pid}`);
@@ -249,7 +249,7 @@ declare module "child_process" {
249
249
  * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
250
250
  *
251
251
  * ```js
252
- * const { spawn } = require('node:child_process');
252
+ * import { spawn } from 'node:child_process';
253
253
  * const grep = spawn('grep', ['ssh']);
254
254
  *
255
255
  * grep.on('close', (code, signal) => {
@@ -282,7 +282,7 @@ declare module "child_process" {
282
282
  *
283
283
  * ```js
284
284
  * 'use strict';
285
- * const { spawn } = require('node:child_process');
285
+ * import { spawn } from 'node:child_process';
286
286
  *
287
287
  * const subprocess = spawn(
288
288
  * 'sh',
@@ -320,7 +320,7 @@ declare module "child_process" {
320
320
  * For example, in the parent script:
321
321
  *
322
322
  * ```js
323
- * const cp = require('node:child_process');
323
+ * import cp from 'node:child_process';
324
324
  * const n = cp.fork(`${__dirname}/sub.js`);
325
325
  *
326
326
  * n.on('message', (m) => {
@@ -374,10 +374,12 @@ declare module "child_process" {
374
374
  * a TCP server object to the child process as illustrated in the example below:
375
375
  *
376
376
  * ```js
377
- * const subprocess = require('node:child_process').fork('subprocess.js');
377
+ * import child_process from 'node:child_process';
378
+ * const subprocess = child_process.fork('subprocess.js');
378
379
  *
379
380
  * // Open up the server object and send the handle.
380
- * const server = require('node:net').createServer();
381
+ * import net from 'node:net';
382
+ * const server = net.createServer();
381
383
  * server.on('connection', (socket) => {
382
384
  * socket.end('handled by parent');
383
385
  * });
@@ -412,13 +414,14 @@ declare module "child_process" {
412
414
  * handle connections with "normal" or "special" priority:
413
415
  *
414
416
  * ```js
415
- * const { fork } = require('node:child_process');
417
+ * import { fork } from 'node:child_process';
416
418
  * const normal = fork('subprocess.js', ['normal']);
417
419
  * const special = fork('subprocess.js', ['special']);
418
420
  *
419
421
  * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
420
422
  * // the sockets from being read before they are sent to the child process.
421
- * const server = require('node:net').createServer({ pauseOnConnect: true });
423
+ * import net from 'node:net';
424
+ * const server = net.createServer({ pauseOnConnect: true });
422
425
  * server.on('connection', (socket) => {
423
426
  *
424
427
  * // If this is special priority...
@@ -490,7 +493,7 @@ declare module "child_process" {
490
493
  * the child and the parent.
491
494
  *
492
495
  * ```js
493
- * const { spawn } = require('node:child_process');
496
+ * import { spawn } from 'node:child_process';
494
497
  *
495
498
  * const subprocess = spawn(process.argv[0], ['child_program.js'], {
496
499
  * detached: true,
@@ -508,7 +511,7 @@ declare module "child_process" {
508
511
  * to wait for the child to exit before exiting itself.
509
512
  *
510
513
  * ```js
511
- * const { spawn } = require('node:child_process');
514
+ * import { spawn } from 'node:child_process';
512
515
  *
513
516
  * const subprocess = spawn(process.argv[0], ['child_program.js'], {
514
517
  * detached: true,
@@ -711,7 +714,7 @@ declare module "child_process" {
711
714
  * exit code:
712
715
  *
713
716
  * ```js
714
- * const { spawn } = require('node:child_process');
717
+ * import { spawn } from 'node:child_process';
715
718
  * const ls = spawn('ls', ['-lh', '/usr']);
716
719
  *
717
720
  * ls.stdout.on('data', (data) => {
@@ -730,7 +733,7 @@ declare module "child_process" {
730
733
  * Example: A very elaborate way to run `ps ax | grep ssh`
731
734
  *
732
735
  * ```js
733
- * const { spawn } = require('node:child_process');
736
+ * import { spawn } from 'node:child_process';
734
737
  * const ps = spawn('ps', ['ax']);
735
738
  * const grep = spawn('grep', ['ssh']);
736
739
  *
@@ -767,7 +770,7 @@ declare module "child_process" {
767
770
  * Example of checking for failed `spawn`:
768
771
  *
769
772
  * ```js
770
- * const { spawn } = require('node:child_process');
773
+ * import { spawn } from 'node:child_process';
771
774
  * const subprocess = spawn('bad_command');
772
775
  *
773
776
  * subprocess.on('error', (err) => {
@@ -785,7 +788,7 @@ declare module "child_process" {
785
788
  * the error passed to the callback will be an `AbortError`:
786
789
  *
787
790
  * ```js
788
- * const { spawn } = require('node:child_process');
791
+ * import { spawn } from 'node:child_process';
789
792
  * const controller = new AbortController();
790
793
  * const { signal } = controller;
791
794
  * const grep = spawn('grep', ['ssh'], { signal });
@@ -906,7 +909,7 @@ declare module "child_process" {
906
909
  * need to be dealt with accordingly:
907
910
  *
908
911
  * ```js
909
- * const { exec } = require('node:child_process');
912
+ * import { exec } from 'node:child_process';
910
913
  *
911
914
  * exec('"/path/to/test file/test.sh" arg1 arg2');
912
915
  * // Double quotes are used so that the space in the path is not interpreted as
@@ -932,7 +935,7 @@ declare module "child_process" {
932
935
  * encoding, `Buffer` objects will be passed to the callback instead.
933
936
  *
934
937
  * ```js
935
- * const { exec } = require('node:child_process');
938
+ * import { exec } from 'node:child_process';
936
939
  * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
937
940
  * if (error) {
938
941
  * console.error(`exec error: ${error}`);
@@ -957,8 +960,9 @@ declare module "child_process" {
957
960
  * callback, but with two additional properties `stdout` and `stderr`.
958
961
  *
959
962
  * ```js
960
- * const util = require('node:util');
961
- * const exec = util.promisify(require('node:child_process').exec);
963
+ * import util from 'node:util';
964
+ * import child_process from 'node:child_process';
965
+ * const exec = util.promisify(child_process.exec);
962
966
  *
963
967
  * async function lsExample() {
964
968
  * const { stdout, stderr } = await exec('ls');
@@ -972,7 +976,7 @@ declare module "child_process" {
972
976
  * the error passed to the callback will be an `AbortError`:
973
977
  *
974
978
  * ```js
975
- * const { exec } = require('node:child_process');
979
+ * import { exec } from 'node:child_process';
976
980
  * const controller = new AbortController();
977
981
  * const { signal } = controller;
978
982
  * const child = exec('grep ssh', { signal }, (error) => {
@@ -1096,7 +1100,7 @@ declare module "child_process" {
1096
1100
  * supported.
1097
1101
  *
1098
1102
  * ```js
1099
- * const { execFile } = require('node:child_process');
1103
+ * import { execFile } from 'node:child_process';
1100
1104
  * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
1101
1105
  * if (error) {
1102
1106
  * throw error;
@@ -1119,7 +1123,7 @@ declare module "child_process" {
1119
1123
  * callback, but with two additional properties `stdout` and `stderr`.
1120
1124
  *
1121
1125
  * ```js
1122
- * const util = require('node:util');
1126
+ * import util from 'node:util';
1123
1127
  * const execFile = util.promisify(require('node:child_process').execFile);
1124
1128
  * async function getVersion() {
1125
1129
  * const { stdout } = await execFile('node', ['--version']);
@@ -1136,7 +1140,7 @@ declare module "child_process" {
1136
1140
  * the error passed to the callback will be an `AbortError`:
1137
1141
  *
1138
1142
  * ```js
1139
- * const { execFile } = require('node:child_process');
1143
+ * import { execFile } from 'node:child_process';
1140
1144
  * const controller = new AbortController();
1141
1145
  * const { signal } = controller;
1142
1146
  * const child = execFile('node', ['--version'], { signal }, (error) => {
@@ -1377,7 +1381,7 @@ declare module "child_process" {
1377
1381
  * console.log(`Hello from ${process.argv[2]}!`);
1378
1382
  * }, 1_000);
1379
1383
  * } else {
1380
- * const { fork } = require('node:child_process');
1384
+ * import { fork } from 'node:child_process';
1381
1385
  * const controller = new AbortController();
1382
1386
  * const { signal } = controller;
1383
1387
  * const child = fork(__filename, ['child'], { signal });
@@ -231,6 +231,7 @@ declare module "cluster" {
231
231
  * the `'disconnect'` event has not been emitted after some time.
232
232
  *
233
233
  * ```js
234
+ * import net from 'node:net';
234
235
  * if (cluster.isPrimary) {
235
236
  * const worker = cluster.fork();
236
237
  * let timeout;
@@ -248,7 +249,6 @@ declare module "cluster" {
248
249
  * });
249
250
  *
250
251
  * } else if (cluster.isWorker) {
251
- * const net = require('node:net');
252
252
  * const server = net.createServer((socket) => {
253
253
  * // Connections never end
254
254
  * });
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream.
8
8
  * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and
9
- * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('node:console')`.
9
+ * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
10
10
  *
11
11
  * _**Warning**_: The global console object's methods are neither consistently
12
12
  * synchronous like the browser APIs they resemble, nor are they consistently
@@ -362,7 +362,7 @@ declare module "node:console" {
362
362
  *
363
363
  * * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream.
364
364
  * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and
365
- * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('console')`.
365
+ * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
366
366
  *
367
367
  * _**Warning**_: The global console object's methods are neither consistently
368
368
  * synchronous like the browser APIs they resemble, nor are they consistently
node v20.16/crypto.d.ts CHANGED
@@ -3389,8 +3389,8 @@ declare module "crypto" {
3389
3389
  * Example:
3390
3390
  *
3391
3391
  * ```js
3392
- * const crypto = require('node:crypto');
3393
- * const { Buffer } = require('node:buffer');
3392
+ * import crypto from 'node:crypto';
3393
+ * import { Buffer } from 'node:buffer';
3394
3394
  *
3395
3395
  * // Hashing a string and return the result as a hex-encoded string.
3396
3396
  * const string = 'Node.js';
@@ -4107,7 +4107,7 @@ declare module "crypto" {
4107
4107
  saltLength: number;
4108
4108
  }
4109
4109
  /**
4110
- * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class.
4110
+ * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
4111
4111
  * `Crypto` is a singleton that provides access to the remainder of the crypto API.
4112
4112
  * @since v15.0.0
4113
4113
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `dns.promises` API provides an alternative set of asynchronous DNS methods
3
3
  * that return `Promise` objects rather than using callbacks. The API is accessible
4
- * via `require('node:dns').promises` or `require('node:dns/promises')`.
4
+ * via `import { promises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`.
5
5
  * @since v10.6.0
6
6
  */
7
7
  declare module "dns/promises" {
@@ -60,7 +60,7 @@ declare module "dns/promises" {
60
60
  * Example usage:
61
61
  *
62
62
  * ```js
63
- * const dns = require('node:dns');
63
+ * import dns from 'node:dns';
64
64
  * const dnsPromises = dns.promises;
65
65
  * const options = {
66
66
  * family: 6,
@@ -96,8 +96,8 @@ declare module "dns/promises" {
96
96
  * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code.
97
97
  *
98
98
  * ```js
99
- * const dnsPromises = require('node:dns').promises;
100
- * dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
99
+ * import dns from 'node:dns';
100
+ * dns.promises.lookupService('127.0.0.1', 22).then((result) => {
101
101
  * console.log(result.hostname, result.service);
102
102
  * // Prints: localhost ssh
103
103
  * });
@@ -394,7 +394,8 @@ declare module "dns/promises" {
394
394
  * other resolvers:
395
395
  *
396
396
  * ```js
397
- * const { Resolver } = require('node:dns').promises;
397
+ * import dns from 'node:dns';
398
+ * const { Resolver } = dns.promises;
398
399
  * const resolver = new Resolver();
399
400
  * resolver.setServers(['4.4.4.4']);
400
401
  *
node v20.16/dns.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * system do, use {@link lookup}.
10
10
  *
11
11
  * ```js
12
- * const dns = require('node:dns');
12
+ * import dns from 'node:dns';
13
13
  *
14
14
  * dns.lookup('example.org', (err, address, family) => {
15
15
  * console.log('address: %j family: IPv%s', address, family);
@@ -23,7 +23,7 @@
23
23
  * DNS queries, bypassing other name-resolution facilities.
24
24
  *
25
25
  * ```js
26
- * const dns = require('node:dns');
26
+ * import dns from 'node:dns';
27
27
  *
28
28
  * dns.resolve4('archive.org', (err, addresses) => {
29
29
  * if (err) throw err;
@@ -138,7 +138,7 @@ declare module "dns" {
138
138
  * Example usage:
139
139
  *
140
140
  * ```js
141
- * const dns = require('node:dns');
141
+ * import dns from 'node:dns';
142
142
  * const options = {
143
143
  * family: 6,
144
144
  * hints: dns.ADDRCONFIG | dns.V4MAPPED,
@@ -198,7 +198,7 @@ declare module "dns" {
198
198
  * where `err.code` is the error code.
199
199
  *
200
200
  * ```js
201
- * const dns = require('node:dns');
201
+ * import dns from 'node:dns';
202
202
  * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
203
203
  * console.log(hostname, service);
204
204
  * // Prints: localhost ssh
@@ -786,7 +786,7 @@ declare module "dns" {
786
786
  * other resolvers:
787
787
  *
788
788
  * ```js
789
- * const { Resolver } = require('node:dns');
789
+ * import { Resolver } from 'node:dns';
790
790
  * const resolver = new Resolver();
791
791
  * resolver.setServers(['4.4.4.4']);
792
792
  *
node v20.16/domain.d.ts CHANGED
@@ -63,8 +63,8 @@ declare module "domain" {
63
63
  * This is the most basic way to use a domain.
64
64
  *
65
65
  * ```js
66
- * const domain = require('node:domain');
67
- * const fs = require('node:fs');
66
+ * import domain from 'node:domain';
67
+ * import fs from 'node:fs';
68
68
  * const d = domain.create();
69
69
  * d.on('error', (er) => {
70
70
  * console.error('Caught error!', er);
@@ -929,7 +929,7 @@ declare module "fs/promises" {
929
929
  * The `fsPromises.mkdtemp()` method will append the six randomly selected
930
930
  * 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` must end with a trailing
931
931
  * platform-specific path separator
932
- * (`require('node:path').sep`).
932
+ * (`import { sep } from 'node:node:path'`).
933
933
  * @since v10.0.0
934
934
  * @return Fulfills with a string containing the file system path of the newly created temporary directory.
935
935
  */
@@ -1171,7 +1171,7 @@ declare module "fs/promises" {
1171
1171
  * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
1172
1172
  *
1173
1173
  * ```js
1174
- * const { watch } = require('node:fs/promises');
1174
+ * import { watch } from 'node:fs/promises';
1175
1175
  *
1176
1176
  * const ac = new AbortController();
1177
1177
  * const { signal } = ac;
node v20.16/fs.d.ts CHANGED
@@ -1898,7 +1898,7 @@ declare module "fs" {
1898
1898
  * The `fs.mkdtemp()` method will append the six randomly selected characters
1899
1899
  * directly to the `prefix` string. For instance, given a directory `/tmp`, if the
1900
1900
  * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator
1901
- * (`require('node:path').sep`).
1901
+ * (`import { sep } from 'node:node:path'`).
1902
1902
  *
1903
1903
  * ```js
1904
1904
  * import { tmpdir } from 'node:os';
node v20.16/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * To use the HTTP server and client one must `require('node:http')`.
2
+ * To use the HTTP server and client one must import the `node:http` module.
3
3
  *
4
4
  * The HTTP interfaces in Node.js are designed to support many features
5
5
  * of the protocol which have been traditionally difficult to use.
@@ -1447,7 +1447,7 @@ declare module "http" {
1447
1447
  * To configure any of them, a custom {@link Agent} instance must be created.
1448
1448
  *
1449
1449
  * ```js
1450
- * const http = require('node:http');
1450
+ * import http from 'node:http';
1451
1451
  * const keepAliveAgent = new http.Agent({ keepAlive: true });
1452
1452
  * options.agent = keepAliveAgent;
1453
1453
  * http.request(options, onResponseCallback)