@types/node 16.18.110 → 16.18.111

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 v16.18/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/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 25 Sep 2024 17:36:54 GMT
11
+ * Last updated: Wed, 25 Sep 2024 22:07:42 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
node v16.18/buffer.d.ts CHANGED
@@ -102,7 +102,7 @@ declare module "buffer" {
102
102
  export interface BlobOptions {
103
103
  /**
104
104
  * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
105
- * will be converted to the platform native line-ending as specified by `require('node:os').EOL`.
105
+ * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
106
106
  */
107
107
  endings?: "transparent" | "native";
108
108
  /**
@@ -4,7 +4,7 @@
4
4
  * is primarily provided by the {@link spawn} function:
5
5
  *
6
6
  * ```js
7
- * const { spawn } = require('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) => {
@@ -106,7 +106,7 @@ declare module "child_process" {
106
106
  * refer to the same value.
107
107
  *
108
108
  * ```js
109
- * const { spawn } = require('child_process');
109
+ * import { spawn } from 'node:child_process';
110
110
  *
111
111
  * const subprocess = spawn('ls');
112
112
  *
@@ -151,9 +151,9 @@ declare module "child_process" {
151
151
  * in the array are `null`.
152
152
  *
153
153
  * ```js
154
- * const assert = require('assert');
155
- * const fs = require('fs');
156
- * const child_process = require('child_process');
154
+ * import assert from 'node:assert';
155
+ * import fs from 'node:fs';
156
+ * import child_process from 'node:child_process';
157
157
  *
158
158
  * const subprocess = child_process.spawn('ls', {
159
159
  * stdio: [
@@ -201,7 +201,7 @@ declare module "child_process" {
201
201
  * emitted.
202
202
  *
203
203
  * ```js
204
- * const { spawn } = require('child_process');
204
+ * import { spawn } from 'node:child_process';
205
205
  * const grep = spawn('grep', ['ssh']);
206
206
  *
207
207
  * console.log(`Spawned child pid: ${grep.pid}`);
@@ -248,7 +248,7 @@ declare module "child_process" {
248
248
  * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
249
249
  *
250
250
  * ```js
251
- * const { spawn } = require('child_process');
251
+ * import { spawn } from 'node:child_process';
252
252
  * const grep = spawn('grep', ['ssh']);
253
253
  *
254
254
  * grep.on('close', (code, signal) => {
@@ -281,7 +281,7 @@ declare module "child_process" {
281
281
  *
282
282
  * ```js
283
283
  * 'use strict';
284
- * const { spawn } = require('child_process');
284
+ * import { spawn } from 'node:child_process';
285
285
  *
286
286
  * const subprocess = spawn(
287
287
  * 'sh',
@@ -314,7 +314,7 @@ declare module "child_process" {
314
314
  * For example, in the parent script:
315
315
  *
316
316
  * ```js
317
- * const cp = require('child_process');
317
+ * import cp from 'node:child_process';
318
318
  * const n = cp.fork(`${__dirname}/sub.js`);
319
319
  *
320
320
  * n.on('message', (m) => {
@@ -368,10 +368,12 @@ declare module "child_process" {
368
368
  * a TCP server object to the child process as illustrated in the example below:
369
369
  *
370
370
  * ```js
371
- * const subprocess = require('child_process').fork('subprocess.js');
371
+ * import child_process from 'node:child_process';
372
+ * const subprocess = child_process.fork('subprocess.js');
372
373
  *
373
374
  * // Open up the server object and send the handle.
374
- * const server = require('net').createServer();
375
+ * import net from 'node:net';
376
+ * const server = net.createServer();
375
377
  * server.on('connection', (socket) => {
376
378
  * socket.end('handled by parent');
377
379
  * });
@@ -407,13 +409,14 @@ declare module "child_process" {
407
409
  * handle connections with "normal" or "special" priority:
408
410
  *
409
411
  * ```js
410
- * const { fork } = require('child_process');
412
+ * import { fork } from 'node:child_process';
411
413
  * const normal = fork('subprocess.js', ['normal']);
412
414
  * const special = fork('subprocess.js', ['special']);
413
415
  *
414
416
  * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
415
417
  * // the sockets from being read before they are sent to the child process.
416
- * const server = require('net').createServer({ pauseOnConnect: true });
418
+ * import net from 'node:net';
419
+ * const server = net.createServer({ pauseOnConnect: true });
417
420
  * server.on('connection', (socket) => {
418
421
  *
419
422
  * // If this is special priority...
@@ -484,7 +487,7 @@ declare module "child_process" {
484
487
  * the child and the parent.
485
488
  *
486
489
  * ```js
487
- * const { spawn } = require('child_process');
490
+ * import { spawn } from 'node:child_process';
488
491
  *
489
492
  * const subprocess = spawn(process.argv[0], ['child_program.js'], {
490
493
  * detached: true,
@@ -502,7 +505,7 @@ declare module "child_process" {
502
505
  * to wait for the child to exit before exiting itself.
503
506
  *
504
507
  * ```js
505
- * const { spawn } = require('child_process');
508
+ * import { spawn } from 'node:child_process';
506
509
  *
507
510
  * const subprocess = spawn(process.argv[0], ['child_program.js'], {
508
511
  * detached: true,
@@ -705,7 +708,7 @@ declare module "child_process" {
705
708
  * exit code:
706
709
  *
707
710
  * ```js
708
- * const { spawn } = require('child_process');
711
+ * import { spawn } from 'node:child_process';
709
712
  * const ls = spawn('ls', ['-lh', '/usr']);
710
713
  *
711
714
  * ls.stdout.on('data', (data) => {
@@ -724,7 +727,7 @@ declare module "child_process" {
724
727
  * Example: A very elaborate way to run `ps ax | grep ssh`
725
728
  *
726
729
  * ```js
727
- * const { spawn } = require('child_process');
730
+ * import { spawn } from 'node:child_process';
728
731
  * const ps = spawn('ps', ['ax']);
729
732
  * const grep = spawn('grep', ['ssh']);
730
733
  *
@@ -761,7 +764,7 @@ declare module "child_process" {
761
764
  * Example of checking for failed `spawn`:
762
765
  *
763
766
  * ```js
764
- * const { spawn } = require('child_process');
767
+ * import { spawn } from 'node:child_process';
765
768
  * const subprocess = spawn('bad_command');
766
769
  *
767
770
  * subprocess.on('error', (err) => {
@@ -779,7 +782,7 @@ declare module "child_process" {
779
782
  * the error passed to the callback will be an `AbortError`:
780
783
  *
781
784
  * ```js
782
- * const { spawn } = require('child_process');
785
+ * import { spawn } from 'node:child_process';
783
786
  * const controller = new AbortController();
784
787
  * const { signal } = controller;
785
788
  * const grep = spawn('grep', ['ssh'], { signal });
@@ -898,7 +901,7 @@ declare module "child_process" {
898
901
  * need to be dealt with accordingly:
899
902
  *
900
903
  * ```js
901
- * const { exec } = require('child_process');
904
+ * import { exec } from 'node:child_process';
902
905
  *
903
906
  * exec('"/path/to/test file/test.sh" arg1 arg2');
904
907
  * // Double quotes are used so that the space in the path is not interpreted as
@@ -924,7 +927,7 @@ declare module "child_process" {
924
927
  * encoding, `Buffer` objects will be passed to the callback instead.
925
928
  *
926
929
  * ```js
927
- * const { exec } = require('child_process');
930
+ * import { exec } from 'node:child_process';
928
931
  * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
929
932
  * if (error) {
930
933
  * console.error(`exec error: ${error}`);
@@ -949,8 +952,9 @@ declare module "child_process" {
949
952
  * callback, but with two additional properties `stdout` and `stderr`.
950
953
  *
951
954
  * ```js
952
- * const util = require('util');
953
- * const exec = util.promisify(require('child_process').exec);
955
+ * import util from 'node:util';
956
+ * import child_process from 'node:child_process';
957
+ * const exec = util.promisify(child_process.exec);
954
958
  *
955
959
  * async function lsExample() {
956
960
  * const { stdout, stderr } = await exec('ls');
@@ -964,7 +968,7 @@ declare module "child_process" {
964
968
  * the error passed to the callback will be an `AbortError`:
965
969
  *
966
970
  * ```js
967
- * const { exec } = require('child_process');
971
+ * import { exec } from 'node:child_process';
968
972
  * const controller = new AbortController();
969
973
  * const { signal } = controller;
970
974
  * const child = exec('grep ssh', { signal }, (error) => {
@@ -1088,7 +1092,7 @@ declare module "child_process" {
1088
1092
  * supported.
1089
1093
  *
1090
1094
  * ```js
1091
- * const { execFile } = require('child_process');
1095
+ * import { execFile } from 'node:child_process';
1092
1096
  * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
1093
1097
  * if (error) {
1094
1098
  * throw error;
@@ -1111,8 +1115,9 @@ declare module "child_process" {
1111
1115
  * callback, but with two additional properties `stdout` and `stderr`.
1112
1116
  *
1113
1117
  * ```js
1114
- * const util = require('util');
1115
- * const execFile = util.promisify(require('child_process').execFile);
1118
+ * import util from 'node:util';
1119
+ * import child_process from 'node:child_process';
1120
+ * const execFile = util.promisify(child_process.execFile);
1116
1121
  * async function getVersion() {
1117
1122
  * const { stdout } = await execFile('node', ['--version']);
1118
1123
  * console.log(stdout);
@@ -1128,7 +1133,7 @@ declare module "child_process" {
1128
1133
  * the error passed to the callback will be an `AbortError`:
1129
1134
  *
1130
1135
  * ```js
1131
- * const { execFile } = require('child_process');
1136
+ * import { execFile } from 'node:child_process';
1132
1137
  * const controller = new AbortController();
1133
1138
  * const { signal } = controller;
1134
1139
  * const child = execFile('node', ['--version'], { signal }, (error) => {
@@ -1364,12 +1369,12 @@ declare module "child_process" {
1364
1369
  * the error passed to the callback will be an `AbortError`:
1365
1370
  *
1366
1371
  * ```js
1372
+ * import { fork } from 'node:child_process';
1367
1373
  * if (process.argv[2] === 'child') {
1368
1374
  * setTimeout(() => {
1369
1375
  * console.log(`Hello from ${process.argv[2]}!`);
1370
1376
  * }, 1_000);
1371
1377
  * } else {
1372
- * const { fork } = require('child_process');
1373
1378
  * const controller = new AbortController();
1374
1379
  * const { signal } = controller;
1375
1380
  * 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-v16.x/api/process.html#processstdout) and
9
- * [`process.stderr`](https://nodejs.org/docs/latest-v16.x/api/process.html#processstderr). The global `console` can be used without calling `require('node:console')`.
9
+ * [`process.stderr`](https://nodejs.org/docs/latest-v16.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-v16.x/api/process.html#processstdout) and
365
- * [`process.stderr`](https://nodejs.org/docs/latest-v16.x/api/process.html#processstderr). The global `console` can be used without calling `require('console')`.
365
+ * [`process.stderr`](https://nodejs.org/docs/latest-v16.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 v16.18/crypto.d.ts CHANGED
@@ -3957,7 +3957,7 @@ declare module "crypto" {
3957
3957
  saltLength: number;
3958
3958
  }
3959
3959
  /**
3960
- * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class.
3960
+ * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
3961
3961
  * `Crypto` is a singleton that provides access to the remainder of the crypto API.
3962
3962
  * @since v15.0.0
3963
3963
  */
@@ -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-v16.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
  * });
@@ -383,7 +383,8 @@ declare module "dns/promises" {
383
383
  * other resolvers:
384
384
  *
385
385
  * ```js
386
- * const { Resolver } = require('node:dns').promises;
386
+ * import dns from 'node:dns';
387
+ * const { Resolver } = dns.promises;
387
388
  * const resolver = new Resolver();
388
389
  * resolver.setServers(['4.4.4.4']);
389
390
  *
node v16.18/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;
@@ -129,7 +129,7 @@ declare module "dns" {
129
129
  * Example usage:
130
130
  *
131
131
  * ```js
132
- * const dns = require('node:dns');
132
+ * import dns from 'node:dns';
133
133
  * const options = {
134
134
  * family: 6,
135
135
  * hints: dns.ADDRCONFIG | dns.V4MAPPED,
@@ -189,7 +189,7 @@ declare module "dns" {
189
189
  * where `err.code` is the error code.
190
190
  *
191
191
  * ```js
192
- * const dns = require('node:dns');
192
+ * import dns from 'node:dns';
193
193
  * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
194
194
  * console.log(hostname, service);
195
195
  * // Prints: localhost ssh
@@ -766,7 +766,7 @@ declare module "dns" {
766
766
  * other resolvers:
767
767
  *
768
768
  * ```js
769
- * const { Resolver } = require('node:dns');
769
+ * import { Resolver } from 'node:dns';
770
770
  * const resolver = new Resolver();
771
771
  * resolver.setServers(['4.4.4.4']);
772
772
  *
node v16.18/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('domain');
67
- * const fs = require('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);
node v16.18/events.d.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  * the `eventEmitter.emit()` method is used to trigger the event.
23
23
  *
24
24
  * ```js
25
- * const EventEmitter = require('events');
25
+ * import EventEmitter from 'node:events';
26
26
  *
27
27
  * class MyEmitter extends EventEmitter {}
28
28
  *
@@ -79,7 +79,7 @@ declare module "events" {
79
79
  * The `EventEmitter` class is defined and exposed by the `events` module:
80
80
  *
81
81
  * ```js
82
- * const EventEmitter = require('events');
82
+ * import EventEmitter from 'node:events';
83
83
  * ```
84
84
  *
85
85
  * All `EventEmitter`s emit the event `'newListener'` when new listeners are
@@ -103,7 +103,7 @@ declare module "events" {
103
103
  * semantics and does not listen to the `'error'` event.
104
104
  *
105
105
  * ```js
106
- * const { once, EventEmitter } = require('events');
106
+ * import { once, EventEmitter } from 'node:events';
107
107
  *
108
108
  * async function run() {
109
109
  * const ee = new EventEmitter();
@@ -135,7 +135,7 @@ declare module "events" {
135
135
  * special handling:
136
136
  *
137
137
  * ```js
138
- * const { EventEmitter, once } = require('events');
138
+ * import { EventEmitter, once } from 'node:events';
139
139
  *
140
140
  * const ee = new EventEmitter();
141
141
  *
@@ -151,7 +151,7 @@ declare module "events" {
151
151
  * An `AbortSignal` can be used to cancel waiting for the event:
152
152
  *
153
153
  * ```js
154
- * const { EventEmitter, once } = require('events');
154
+ * import { EventEmitter, once } from 'node:events';
155
155
  *
156
156
  * const ee = new EventEmitter();
157
157
  * const ac = new AbortController();
@@ -183,7 +183,7 @@ declare module "events" {
183
183
  static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
184
184
  /**
185
185
  * ```js
186
- * const { on, EventEmitter } = require('events');
186
+ * import { on, EventEmitter } from 'node:events';
187
187
  *
188
188
  * (async () => {
189
189
  * const ee = new EventEmitter();
@@ -212,7 +212,7 @@ declare module "events" {
212
212
  * An `AbortSignal` can be used to cancel waiting on events:
213
213
  *
214
214
  * ```js
215
- * const { on, EventEmitter } = require('events');
215
+ * import { on, EventEmitter } from 'node:events';
216
216
  * const ac = new AbortController();
217
217
  *
218
218
  * (async () => {
@@ -248,7 +248,7 @@ declare module "events" {
248
248
  * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
249
249
  *
250
250
  * ```js
251
- * const { EventEmitter, listenerCount } = require('events');
251
+ * import { EventEmitter, listenerCount } from 'node:events';
252
252
  * const myEmitter = new EventEmitter();
253
253
  * myEmitter.on('event', () => {});
254
254
  * myEmitter.on('event', () => {});
@@ -271,7 +271,7 @@ declare module "events" {
271
271
  * event target. This is useful for debugging and diagnostic purposes.
272
272
  *
273
273
  * ```js
274
- * const { getEventListeners, EventEmitter } = require('events');
274
+ * import { getEventListeners, EventEmitter } from 'node:events';
275
275
  *
276
276
  * {
277
277
  * const ee = new EventEmitter();
@@ -291,10 +291,10 @@ declare module "events" {
291
291
  static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
292
292
  /**
293
293
  * ```js
294
- * const {
294
+ * import {
295
295
  * setMaxListeners,
296
296
  * EventEmitter
297
- * } = require('events');
297
+ * } from 'node:events';
298
298
  *
299
299
  * const target = new EventTarget();
300
300
  * const emitter = new EventEmitter();
@@ -610,7 +610,7 @@ declare module "events" {
610
610
  * Returns `true` if the event had listeners, `false` otherwise.
611
611
  *
612
612
  * ```js
613
- * const EventEmitter = require('events');
613
+ * import EventEmitter from 'node:events';
614
614
  * const myEmitter = new EventEmitter();
615
615
  *
616
616
  * // First listener
@@ -689,7 +689,7 @@ declare module "events" {
689
689
  * listeners. The values in the array are strings or `Symbol`s.
690
690
  *
691
691
  * ```js
692
- * const EventEmitter = require('events');
692
+ * import EventEmitter from 'node:events';
693
693
  * const myEE = new EventEmitter();
694
694
  * myEE.on('foo', () => {});
695
695
  * myEE.on('bar', () => {});
@@ -830,7 +830,7 @@ declare module "fs/promises" {
830
830
  * The `fsPromises.mkdtemp()` method will append the six randomly selected
831
831
  * 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
832
832
  * platform-specific path separator
833
- * (`require('path').sep`).
833
+ * (`import { sep } from 'node:path'`).
834
834
  * @since v10.0.0
835
835
  * @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
836
836
  */
@@ -1050,7 +1050,7 @@ declare module "fs/promises" {
1050
1050
  * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
1051
1051
  *
1052
1052
  * ```js
1053
- * const { watch } = require('fs/promises');
1053
+ * import { watch } from 'node:fs/promises';
1054
1054
  *
1055
1055
  * const ac = new AbortController();
1056
1056
  * const { signal } = ac;
node v16.18/fs.d.ts CHANGED
@@ -1747,7 +1747,7 @@ declare module "fs" {
1747
1747
  * The `fs.mkdtemp()` method will append the six randomly selected characters
1748
1748
  * directly to the `prefix` string. For instance, given a directory `/tmp`, if the
1749
1749
  * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator
1750
- * (`require('path').sep`).
1750
+ * (`import { sep } from 'node:path'`).
1751
1751
  *
1752
1752
  * ```js
1753
1753
  * import { tmpdir } from 'os';
node v16.18/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * To use the HTTP server and client one must `require('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.
@@ -1315,7 +1315,7 @@ declare module "http" {
1315
1315
  * upload a file with a POST request, then write to the `ClientRequest` object.
1316
1316
  *
1317
1317
  * ```js
1318
- * const http = require('http');
1318
+ * import http from 'node:http';
1319
1319
  *
1320
1320
  * const postData = JSON.stringify({
1321
1321
  * 'msg': 'Hello World!'