@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/http2.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * It can be accessed using:
4
4
  *
5
5
  * ```js
6
- * const http2 = require('node:http2');
6
+ * import http2 from 'node:http2';
7
7
  * ```
8
8
  * @since v8.4.0
9
9
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http2.js)
@@ -157,7 +157,7 @@ declare module "http2" {
157
157
  priority(options: StreamPriorityOptions): void;
158
158
  /**
159
159
  * ```js
160
- * const http2 = require('node:http2');
160
+ * import http2 from 'node:http2';
161
161
  * const client = http2.connect('http://example.org:8000');
162
162
  * const { NGHTTP2_CANCEL } = http2.constants;
163
163
  * const req = client.request({ ':path': '/' });
@@ -177,7 +177,7 @@ declare module "http2" {
177
177
  * trailers can be sent.
178
178
  *
179
179
  * ```js
180
- * const http2 = require('node:http2');
180
+ * import http2 from 'node:http2';
181
181
  * const server = http2.createServer();
182
182
  * server.on('stream', (stream) => {
183
183
  * stream.respond(undefined, { waitForTrailers: true });
@@ -368,7 +368,7 @@ declare module "http2" {
368
368
  * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument.
369
369
  *
370
370
  * ```js
371
- * const http2 = require('node:http2');
371
+ * import http2 from 'node:http2';
372
372
  * const server = http2.createServer();
373
373
  * server.on('stream', (stream) => {
374
374
  * stream.respond({ ':status': 200 });
@@ -400,7 +400,7 @@ declare module "http2" {
400
400
  ): void;
401
401
  /**
402
402
  * ```js
403
- * const http2 = require('node:http2');
403
+ * import http2 from 'node:http2';
404
404
  * const server = http2.createServer();
405
405
  * server.on('stream', (stream) => {
406
406
  * stream.respond({ ':status': 200 });
@@ -416,7 +416,7 @@ declare module "http2" {
416
416
  * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`.
417
417
  *
418
418
  * ```js
419
- * const http2 = require('node:http2');
419
+ * import http2 from 'node:http2';
420
420
  * const server = http2.createServer();
421
421
  * server.on('stream', (stream) => {
422
422
  * stream.respond({ ':status': 200 }, { waitForTrailers: true });
@@ -439,8 +439,8 @@ declare module "http2" {
439
439
  * automatically.
440
440
  *
441
441
  * ```js
442
- * const http2 = require('node:http2');
443
- * const fs = require('node:fs');
442
+ * import http2 from 'node:http2';
443
+ * import fs from 'node:fs';
444
444
  *
445
445
  * const server = http2.createServer();
446
446
  * server.on('stream', (stream) => {
@@ -482,8 +482,8 @@ declare module "http2" {
482
482
  * or `http2stream.close()` to close the `Http2Stream`.
483
483
  *
484
484
  * ```js
485
- * const http2 = require('node:http2');
486
- * const fs = require('node:fs');
485
+ * import http2 from 'node:http2';
486
+ * import fs from 'node:fs';
487
487
  *
488
488
  * const server = http2.createServer();
489
489
  * server.on('stream', (stream) => {
@@ -529,7 +529,7 @@ declare module "http2" {
529
529
  * Example using a file path:
530
530
  *
531
531
  * ```js
532
- * const http2 = require('node:http2');
532
+ * import http2 from 'node:http2';
533
533
  * const server = http2.createServer();
534
534
  * server.on('stream', (stream) => {
535
535
  * function statCheck(stat, headers) {
@@ -563,7 +563,7 @@ declare module "http2" {
563
563
  * results to determine if the file has been modified to return an appropriate `304` response:
564
564
  *
565
565
  * ```js
566
- * const http2 = require('node:http2');
566
+ * import http2 from 'node:http2';
567
567
  * const server = http2.createServer();
568
568
  * server.on('stream', (stream) => {
569
569
  * function statCheck(stat, headers) {
@@ -596,7 +596,7 @@ declare module "http2" {
596
596
  * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`.
597
597
  *
598
598
  * ```js
599
- * const http2 = require('node:http2');
599
+ * import http2 from 'node:http2';
600
600
  * const server = http2.createServer();
601
601
  * server.on('stream', (stream) => {
602
602
  * stream.respondWithFile('/some/file',
@@ -805,7 +805,7 @@ declare module "http2" {
805
805
  * the delta.
806
806
  *
807
807
  * ```js
808
- * const http2 = require('node:http2');
808
+ * import http2 from 'node:http2';
809
809
  *
810
810
  * const server = http2.createServer();
811
811
  * const expectedWindowSize = 2 ** 20;
@@ -932,7 +932,7 @@ declare module "http2" {
932
932
  * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`.
933
933
  *
934
934
  * ```js
935
- * const http2 = require('node:http2');
935
+ * import http2 from 'node:http2';
936
936
  * const clientSession = http2.connect('https://localhost:1234');
937
937
  * const {
938
938
  * HTTP2_HEADER_PATH,
@@ -1065,7 +1065,7 @@ declare module "http2" {
1065
1065
  * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client.
1066
1066
  *
1067
1067
  * ```js
1068
- * const http2 = require('node:http2');
1068
+ * import http2 from 'node:http2';
1069
1069
  *
1070
1070
  * const server = http2.createServer();
1071
1071
  * server.on('session', (session) => {
@@ -1106,7 +1106,7 @@ declare module "http2" {
1106
1106
  * authoritative responses.
1107
1107
  *
1108
1108
  * ```js
1109
- * const http2 = require('node:http2');
1109
+ * import http2 from 'node:http2';
1110
1110
  * const options = getSecureOptionsSomehow();
1111
1111
  * const server = http2.createSecureServer(options);
1112
1112
  * server.on('stream', (stream) => {
@@ -1132,7 +1132,7 @@ declare module "http2" {
1132
1132
  * server using the `http2.createSecureServer()` method:
1133
1133
  *
1134
1134
  * ```js
1135
- * const http2 = require('node:http2');
1135
+ * import http2 from 'node:http2';
1136
1136
  * const options = getSecureOptionsSomehow();
1137
1137
  * options.origins = ['https://example.com', 'https://example.org'];
1138
1138
  * const server = http2.createSecureServer(options);
@@ -1835,7 +1835,7 @@ declare module "http2" {
1835
1835
  * All other interactions will be routed directly to the socket.
1836
1836
  *
1837
1837
  * ```js
1838
- * const http2 = require('node:http2');
1838
+ * import http2 from 'node:http2';
1839
1839
  * const server = http2.createServer((req, res) => {
1840
1840
  * const ip = req.socket.remoteAddress;
1841
1841
  * const port = req.socket.remotePort;
@@ -2411,7 +2411,7 @@ declare module "http2" {
2411
2411
  * for use with the `HTTP2-Settings` header field.
2412
2412
  *
2413
2413
  * ```js
2414
- * const http2 = require('node:http2');
2414
+ * import http2 from 'node:http2';
2415
2415
  *
2416
2416
  * const packed = http2.getPackedSettings({ enablePush: false });
2417
2417
  *
@@ -2436,7 +2436,7 @@ declare module "http2" {
2436
2436
  * with browser clients.
2437
2437
  *
2438
2438
  * ```js
2439
- * const http2 = require('node:http2');
2439
+ * import http2 from 'node:http2';
2440
2440
  *
2441
2441
  * // Create an unencrypted HTTP/2 server.
2442
2442
  * // Since there are no browsers known that support
@@ -2473,8 +2473,8 @@ declare module "http2" {
2473
2473
  * Returns a `tls.Server` instance that creates and manages `Http2Session` instances.
2474
2474
  *
2475
2475
  * ```js
2476
- * const http2 = require('node:http2');
2477
- * const fs = require('node:fs');
2476
+ * import http2 from 'node:http2';
2477
+ * import fs from 'node:fs';
2478
2478
  *
2479
2479
  * const options = {
2480
2480
  * key: fs.readFileSync('server-key.pem'),
@@ -2513,7 +2513,7 @@ declare module "http2" {
2513
2513
  * Returns a `ClientHttp2Session` instance.
2514
2514
  *
2515
2515
  * ```js
2516
- * const http2 = require('node:http2');
2516
+ * import http2 from 'node:http2';
2517
2517
  * const client = http2.connect('https://localhost:1234');
2518
2518
  *
2519
2519
  * // Use the client
node v20.16/https.d.ts CHANGED
@@ -270,8 +270,8 @@ declare module "https" {
270
270
  /**
271
271
  * ```js
272
272
  * // curl -k https://localhost:8000/
273
- * const https = require('node:https');
274
- * const fs = require('node:fs');
273
+ * import https from 'node:https';
274
+ * import fs from 'node:fs';
275
275
  *
276
276
  * const options = {
277
277
  * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
@@ -287,8 +287,8 @@ declare module "https" {
287
287
  * Or
288
288
  *
289
289
  * ```js
290
- * const https = require('node:https');
291
- * const fs = require('node:fs');
290
+ * import https from 'node:https';
291
+ * import fs from 'node:fs';
292
292
  *
293
293
  * const options = {
294
294
  * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
@@ -328,7 +328,7 @@ declare module "https" {
328
328
  * upload a file with a POST request, then write to the `ClientRequest` object.
329
329
  *
330
330
  * ```js
331
- * const https = require('node:https');
331
+ * import https from 'node:https';
332
332
  *
333
333
  * const options = {
334
334
  * hostname: 'encrypted.google.com',
@@ -401,9 +401,9 @@ declare module "https" {
401
401
  * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
402
402
  *
403
403
  * ```js
404
- * const tls = require('node:tls');
405
- * const https = require('node:https');
406
- * const crypto = require('node:crypto');
404
+ * import tls from 'node:tls';
405
+ * import https from 'node:https';
406
+ * import crypto from 'node:crypto';
407
407
  *
408
408
  * function sha256(s) {
409
409
  * return crypto.createHash('sha256').update(s).digest('base64');
@@ -511,7 +511,7 @@ declare module "https" {
511
511
  * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
512
512
  *
513
513
  * ```js
514
- * const https = require('node:https');
514
+ * import https from 'node:https';
515
515
  *
516
516
  * https.get('https://encrypted.google.com/', (res) => {
517
517
  * console.log('statusCode:', res.statusCode);
node v20.16/module.d.ts CHANGED
@@ -12,9 +12,9 @@ declare module "module" {
12
12
  * does not add or remove exported names from the `ES Modules`.
13
13
  *
14
14
  * ```js
15
- * const fs = require('node:fs');
16
- * const assert = require('node:assert');
17
- * const { syncBuiltinESMExports } = require('node:module');
15
+ * import fs from 'node:fs';
16
+ * import assert from 'node:assert';
17
+ * import { syncBuiltinESMExports } from 'node:module';
18
18
  *
19
19
  * fs.readFile = newAPI;
20
20
  *
node v20.16/net.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * It can be accessed using:
9
9
  *
10
10
  * ```js
11
- * const net = require('node:net');
11
+ * import net from 'node:net';
12
12
  * ```
13
13
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/net.js)
14
14
  */
@@ -812,7 +812,7 @@ declare module "net" {
812
812
  * on port 8124:
813
813
  *
814
814
  * ```js
815
- * const net = require('node:net');
815
+ * import net from 'node:net';
816
816
  * const server = net.createServer((c) => {
817
817
  * // 'connection' listener.
818
818
  * console.log('client connected');
node v20.16/os.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * properties. It can be accessed using:
4
4
  *
5
5
  * ```js
6
- * const os = require('node:os');
6
+ * import os from 'node:os';
7
7
  * ```
8
8
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/os.js)
9
9
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.16.7",
3
+ "version": "20.16.9",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -212,6 +212,6 @@
212
212
  "dependencies": {
213
213
  "undici-types": "~6.19.2"
214
214
  },
215
- "typesPublisherContentHash": "9326145ed41c1525e16af553948df56adfc41def85811d321bd927c0f4815960",
215
+ "typesPublisherContentHash": "e16403d24c55ace9f5c3c86af9a611c05bbf11a18b2b31d77cfb8afb3868e988",
216
216
  "typeScriptVersion": "4.8"
217
217
  }
node v20.16/path.d.ts CHANGED
@@ -11,7 +11,7 @@ declare module "path/win32" {
11
11
  * paths. It can be accessed using:
12
12
  *
13
13
  * ```js
14
- * const path = require('node:path');
14
+ * import path from 'node:path';
15
15
  * ```
16
16
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/path.js)
17
17
  */
@@ -10,7 +10,7 @@
10
10
  * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/)
11
11
  *
12
12
  * ```js
13
- * const { PerformanceObserver, performance } = require('node:perf_hooks');
13
+ * import { PerformanceObserver, performance } from 'node:perf_hooks';
14
14
  *
15
15
  * const obs = new PerformanceObserver((items) => {
16
16
  * console.log(items.getEntries()[0].duration);
@@ -348,10 +348,10 @@ declare module "perf_hooks" {
348
348
  * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
349
349
  *
350
350
  * ```js
351
- * const {
351
+ * import {
352
352
  * performance,
353
353
  * PerformanceObserver,
354
- * } = require('node:perf_hooks');
354
+ * } from 'node:perf_hooks';
355
355
  *
356
356
  * function someFunction() {
357
357
  * console.log('hello world');
@@ -390,10 +390,10 @@ declare module "perf_hooks" {
390
390
  * with respect to `performanceEntry.startTime`.
391
391
  *
392
392
  * ```js
393
- * const {
393
+ * import {
394
394
  * performance,
395
395
  * PerformanceObserver,
396
- * } = require('node:perf_hooks');
396
+ * } from 'node:perf_hooks';
397
397
  *
398
398
  * const obs = new PerformanceObserver((perfObserverList, observer) => {
399
399
  * console.log(perfObserverList.getEntries());
@@ -433,10 +433,10 @@ declare module "perf_hooks" {
433
433
  * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
434
434
  *
435
435
  * ```js
436
- * const {
436
+ * import {
437
437
  * performance,
438
438
  * PerformanceObserver,
439
- * } = require('node:perf_hooks');
439
+ * } from 'node:perf_hooks';
440
440
  *
441
441
  * const obs = new PerformanceObserver((perfObserverList, observer) => {
442
442
  * console.log(perfObserverList.getEntriesByName('meow'));
@@ -484,10 +484,10 @@ declare module "perf_hooks" {
484
484
  * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`.
485
485
  *
486
486
  * ```js
487
- * const {
487
+ * import {
488
488
  * performance,
489
489
  * PerformanceObserver,
490
- * } = require('node:perf_hooks');
490
+ * } from 'node:perf_hooks';
491
491
  *
492
492
  * const obs = new PerformanceObserver((perfObserverList, observer) => {
493
493
  * console.log(perfObserverList.getEntriesByType('mark'));
@@ -537,10 +537,10 @@ declare module "perf_hooks" {
537
537
  * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
538
538
  *
539
539
  * ```js
540
- * const {
540
+ * import {
541
541
  * performance,
542
542
  * PerformanceObserver,
543
- * } = require('node:perf_hooks');
543
+ * } from 'node:perf_hooks';
544
544
  *
545
545
  * const obs = new PerformanceObserver((list, observer) => {
546
546
  * // Called once asynchronously. `list` contains three items.
@@ -809,7 +809,7 @@ declare module "perf_hooks" {
809
809
  * detect.
810
810
  *
811
811
  * ```js
812
- * const { monitorEventLoopDelay } = require('node:perf_hooks');
812
+ * import { monitorEventLoopDelay } from 'node:perf_hooks';
813
813
  * const h = monitorEventLoopDelay({ resolution: 20 });
814
814
  * h.enable();
815
815
  * // Do something.
@@ -858,7 +858,7 @@ declare module "perf_hooks" {
858
858
  } from "perf_hooks";
859
859
  global {
860
860
  /**
861
- * `PerformanceEntry` is a global reference for `require('node:perf_hooks').PerformanceEntry`
861
+ * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:node:perf_hooks'`
862
862
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceentry
863
863
  * @since v19.0.0
864
864
  */
@@ -868,7 +868,7 @@ declare module "perf_hooks" {
868
868
  } ? T
869
869
  : typeof _PerformanceEntry;
870
870
  /**
871
- * `PerformanceMark` is a global reference for `require('node:perf_hooks').PerformanceMark`
871
+ * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:node:perf_hooks'`
872
872
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemark
873
873
  * @since v19.0.0
874
874
  */
@@ -878,7 +878,7 @@ declare module "perf_hooks" {
878
878
  } ? T
879
879
  : typeof _PerformanceMark;
880
880
  /**
881
- * `PerformanceMeasure` is a global reference for `require('node:perf_hooks').PerformanceMeasure`
881
+ * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:node:perf_hooks'`
882
882
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemeasure
883
883
  * @since v19.0.0
884
884
  */
@@ -888,7 +888,7 @@ declare module "perf_hooks" {
888
888
  } ? T
889
889
  : typeof _PerformanceMeasure;
890
890
  /**
891
- * `PerformanceObserver` is a global reference for `require('node:perf_hooks').PerformanceObserver`
891
+ * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:node:perf_hooks'`
892
892
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserver
893
893
  * @since v19.0.0
894
894
  */
@@ -898,7 +898,7 @@ declare module "perf_hooks" {
898
898
  } ? T
899
899
  : typeof _PerformanceObserver;
900
900
  /**
901
- * `PerformanceObserverEntryList` is a global reference for `require('node:perf_hooks').PerformanceObserverEntryList`
901
+ * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:node:perf_hooks'`
902
902
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserverentrylist
903
903
  * @since v19.0.0
904
904
  */
@@ -908,7 +908,7 @@ declare module "perf_hooks" {
908
908
  } ? T
909
909
  : typeof _PerformanceObserverEntryList;
910
910
  /**
911
- * `PerformanceResourceTiming` is a global reference for `require('node:perf_hooks').PerformanceResourceTiming`
911
+ * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:node:perf_hooks'`
912
912
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceresourcetiming
913
913
  * @since v19.0.0
914
914
  */
@@ -918,7 +918,7 @@ declare module "perf_hooks" {
918
918
  } ? T
919
919
  : typeof _PerformanceResourceTiming;
920
920
  /**
921
- * `performance` is a global reference for `require('node:perf_hooks').performance`
921
+ * `performance` is a global reference for `import { performance } from 'node:node:perf_hooks'`
922
922
  * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performance
923
923
  * @since v16.0.0
924
924
  */
@@ -8,7 +8,7 @@
8
8
  * can be accessed using:
9
9
  *
10
10
  * ```js
11
- * const punycode = require('punycode');
11
+ * import punycode from 'node:punycode';
12
12
  * ```
13
13
  *
14
14
  * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
@@ -3,7 +3,7 @@
3
3
  * query strings. It can be accessed using:
4
4
  *
5
5
  * ```js
6
- * const querystring = require('node:querystring');
6
+ * import querystring from 'node:querystring';
7
7
  * ```
8
8
  *
9
9
  * `querystring` is more performant than `URLSearchParams` but is not a
@@ -115,7 +115,7 @@ declare module "readline/promises" {
115
115
  * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
116
116
  *
117
117
  * ```js
118
- * const readlinePromises = require('node:readline/promises');
118
+ * import readlinePromises from 'node:readline/promises';
119
119
  * const rl = readlinePromises.createInterface({
120
120
  * input: process.stdin,
121
121
  * output: process.stdout,
@@ -342,7 +342,7 @@ declare module "readline" {
342
342
  * The `readline.createInterface()` method creates a new `readline.Interface` instance.
343
343
  *
344
344
  * ```js
345
- * const readline = require('node:readline');
345
+ * import readline from 'node:readline';
346
346
  * const rl = readline.createInterface({
347
347
  * input: process.stdin,
348
348
  * output: process.stdout,
@@ -398,7 +398,7 @@ declare module "readline" {
398
398
  * implement a small command-line interface:
399
399
  *
400
400
  * ```js
401
- * const readline = require('node:readline');
401
+ * import readline from 'node:readline';
402
402
  * const rl = readline.createInterface({
403
403
  * input: process.stdin,
404
404
  * output: process.stdout,
@@ -430,8 +430,8 @@ declare module "readline" {
430
430
  * well as a `for await...of` loop:
431
431
  *
432
432
  * ```js
433
- * const fs = require('node:fs');
434
- * const readline = require('node:readline');
433
+ * import fs from 'node:fs';
434
+ * import readline from 'node:readline';
435
435
  *
436
436
  * async function processLineByLine() {
437
437
  * const fileStream = fs.createReadStream('input.txt');
@@ -455,8 +455,8 @@ declare module "readline" {
455
455
  * Alternatively, one could use the `'line'` event:
456
456
  *
457
457
  * ```js
458
- * const fs = require('node:fs');
459
- * const readline = require('node:readline');
458
+ * import fs from 'node:fs';
459
+ * import readline from 'node:readline';
460
460
  *
461
461
  * const rl = readline.createInterface({
462
462
  * input: fs.createReadStream('sample.txt'),
@@ -471,9 +471,9 @@ declare module "readline" {
471
471
  * Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied:
472
472
  *
473
473
  * ```js
474
- * const { once } = require('node:events');
475
- * const { createReadStream } = require('node:fs');
476
- * const { createInterface } = require('node:readline');
474
+ * import { once } from 'node:events';
475
+ * import { createReadStream } from 'node:fs';
476
+ * import { createInterface } from 'node:readline';
477
477
  *
478
478
  * (async function processLineByLine() {
479
479
  * try {
node v20.16/repl.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * applications. It can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const repl = require('node:repl');
7
+ * import repl from 'node:repl';
8
8
  * ```
9
9
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/repl.js)
10
10
  */
@@ -130,7 +130,7 @@ declare module "repl" {
130
130
  * or directly using the JavaScript `new` keyword.
131
131
  *
132
132
  * ```js
133
- * const repl = require('node:repl');
133
+ * import repl from 'node:repl';
134
134
  *
135
135
  * const options = { useColors: true };
136
136
  *
@@ -257,7 +257,7 @@ declare module "repl" {
257
257
  * The following example shows two new commands added to the REPL instance:
258
258
  *
259
259
  * ```js
260
- * const repl = require('node:repl');
260
+ * import repl from 'node:repl';
261
261
  *
262
262
  * const replServer = repl.start({ prompt: '> ' });
263
263
  * replServer.defineCommand('sayhello', {
@@ -407,7 +407,7 @@ declare module "repl" {
407
407
  * If `options` is a string, then it specifies the input prompt:
408
408
  *
409
409
  * ```js
410
- * const repl = require('node:repl');
410
+ * import repl from 'node:repl';
411
411
  *
412
412
  * // a Unix style prompt
413
413
  * repl.start('$ ');