@types/node 22.7.1 → 22.7.3
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 +1 -1
- node/assert.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +4 -4
- node/child_process.d.ts +34 -29
- node/cluster.d.ts +2 -1
- node/console.d.ts +2 -2
- node/crypto.d.ts +3 -3
- node/dns/promises.d.ts +5 -5
- node/dns.d.ts +5 -5
- node/domain.d.ts +2 -2
- node/fs/promises.d.ts +2 -2
- node/fs.d.ts +2 -2
- node/http.d.ts +2 -2
- node/http2.d.ts +24 -24
- node/https.d.ts +9 -9
- node/module.d.ts +3 -3
- node/net.d.ts +2 -2
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +19 -19
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline/promises.d.ts +1 -1
- node/readline.d.ts +9 -9
- node/repl.d.ts +4 -4
- node/sqlite.d.ts +1 -1
- node/stream/web.d.ts +17 -17
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +3 -3
- node/test.d.ts +2 -2
- node/timers/promises.d.ts +5 -5
- node/timers.d.ts +1 -1
- node/tls.d.ts +5 -5
- node/trace_events.d.ts +4 -4
- node/tty.d.ts +1 -1
- node/url.d.ts +7 -7
- node/util.d.ts +44 -44
- node/v8.d.ts +12 -12
- node/vm.d.ts +13 -13
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +22 -22
- node/zlib.d.ts +8 -8
node/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.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Thu, 26 Sep 2024 17:08:07 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/assert.d.ts
CHANGED
@@ -966,7 +966,7 @@ declare module "assert" {
|
|
966
966
|
* To use strict assertion mode:
|
967
967
|
*
|
968
968
|
* ```js
|
969
|
-
* import { strict as assert } from 'node:assert';
|
969
|
+
* import { strict as assert } from 'node:assert';
|
970
970
|
* import assert from 'node:assert/strict';
|
971
971
|
* ```
|
972
972
|
*
|
node/async_hooks.d.ts
CHANGED
node/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 `
|
137
|
+
* will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
|
138
138
|
*/
|
139
139
|
endings?: "transparent" | "native";
|
140
140
|
/**
|
@@ -210,7 +210,7 @@ declare module "buffer" {
|
|
210
210
|
export interface FileOptions {
|
211
211
|
/**
|
212
212
|
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
|
213
|
-
* converted to the platform native line-ending as specified by `
|
213
|
+
* converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
|
214
214
|
*/
|
215
215
|
endings?: "native" | "transparent";
|
216
216
|
/** The File content-type. */
|
@@ -2286,7 +2286,7 @@ declare module "buffer" {
|
|
2286
2286
|
function btoa(data: string): string;
|
2287
2287
|
interface Blob extends _Blob {}
|
2288
2288
|
/**
|
2289
|
-
* `Blob` class is a global reference for `
|
2289
|
+
* `Blob` class is a global reference for `import { Blob } from 'node:buffer'`
|
2290
2290
|
* https://nodejs.org/api/buffer.html#class-blob
|
2291
2291
|
* @since v18.0.0
|
2292
2292
|
*/
|
@@ -2294,7 +2294,7 @@ declare module "buffer" {
|
|
2294
2294
|
: typeof import("buffer").Blob;
|
2295
2295
|
interface File extends _File {}
|
2296
2296
|
/**
|
2297
|
-
* `File` class is a global reference for `
|
2297
|
+
* `File` class is a global reference for `import { File } from 'node:buffer'`
|
2298
2298
|
* https://nodejs.org/api/buffer.html#class-file
|
2299
2299
|
* @since v20.0.0
|
2300
2300
|
*/
|
node/child_process.d.ts
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
* is primarily provided by the {@link spawn} function:
|
5
5
|
*
|
6
6
|
* ```js
|
7
|
-
*
|
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
|
-
*
|
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
|
-
*
|
156
|
-
*
|
157
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
377
|
+
* import { createServer } from 'node:net';
|
378
|
+
* import { fork } from 'node:child_process';
|
379
|
+
* const subprocess = fork('subprocess.js');
|
378
380
|
*
|
379
381
|
* // Open up the server object and send the handle.
|
380
|
-
* const server =
|
382
|
+
* const server = 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
|
-
*
|
417
|
+
* import { createServer } from 'node:net';
|
418
|
+
* import { fork } from 'node:child_process';
|
416
419
|
* const normal = fork('subprocess.js', ['normal']);
|
417
420
|
* const special = fork('subprocess.js', ['special']);
|
418
421
|
*
|
419
422
|
* // Open up the server and send sockets to child. Use pauseOnConnect to prevent
|
420
423
|
* // the sockets from being read before they are sent to the child process.
|
421
|
-
* const server =
|
424
|
+
* const server = 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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
961
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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,8 +1123,9 @@ declare module "child_process" {
|
|
1119
1123
|
* callback, but with two additional properties `stdout` and `stderr`.
|
1120
1124
|
*
|
1121
1125
|
* ```js
|
1122
|
-
*
|
1123
|
-
*
|
1126
|
+
* import util from 'node:util';
|
1127
|
+
* import child_process from 'node:child_process';
|
1128
|
+
* const execFile = util.promisify(child_process.execFile);
|
1124
1129
|
* async function getVersion() {
|
1125
1130
|
* const { stdout } = await execFile('node', ['--version']);
|
1126
1131
|
* console.log(stdout);
|
@@ -1136,7 +1141,7 @@ declare module "child_process" {
|
|
1136
1141
|
* the error passed to the callback will be an `AbortError`:
|
1137
1142
|
*
|
1138
1143
|
* ```js
|
1139
|
-
*
|
1144
|
+
* import { execFile } from 'node:child_process';
|
1140
1145
|
* const controller = new AbortController();
|
1141
1146
|
* const { signal } = controller;
|
1142
1147
|
* const child = execFile('node', ['--version'], { signal }, (error) => {
|
@@ -1377,7 +1382,7 @@ declare module "child_process" {
|
|
1377
1382
|
* console.log(`Hello from ${process.argv[2]}!`);
|
1378
1383
|
* }, 1_000);
|
1379
1384
|
* } else {
|
1380
|
-
*
|
1385
|
+
* import { fork } from 'node:child_process';
|
1381
1386
|
* const controller = new AbortController();
|
1382
1387
|
* const { signal } = controller;
|
1383
1388
|
* const child = fork(__filename, ['child'], { signal });
|
node/cluster.d.ts
CHANGED
@@ -231,6 +231,8 @@ 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';
|
235
|
+
*
|
234
236
|
* if (cluster.isPrimary) {
|
235
237
|
* const worker = cluster.fork();
|
236
238
|
* let timeout;
|
@@ -248,7 +250,6 @@ declare module "cluster" {
|
|
248
250
|
* });
|
249
251
|
*
|
250
252
|
* } else if (cluster.isWorker) {
|
251
|
-
* const net = require('node:net');
|
252
253
|
* const server = net.createServer((socket) => {
|
253
254
|
* // Connections never end
|
254
255
|
* });
|
node/console.d.ts
CHANGED
@@ -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-v22.x/api/process.html#processstdout) and
|
9
|
-
* [`process.stderr`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstderr). The global `console` can be used without
|
9
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v22.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-v22.x/api/process.html#processstdout) and
|
365
|
-
* [`process.stderr`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstderr). The global `console` can be used without
|
365
|
+
* [`process.stderr`](https://nodejs.org/docs/latest-v22.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/crypto.d.ts
CHANGED
@@ -3316,8 +3316,8 @@ declare module "crypto" {
|
|
3316
3316
|
* Example:
|
3317
3317
|
*
|
3318
3318
|
* ```js
|
3319
|
-
*
|
3320
|
-
*
|
3319
|
+
* import crypto from 'node:crypto';
|
3320
|
+
* import { Buffer } from 'node:buffer';
|
3321
3321
|
*
|
3322
3322
|
* // Hashing a string and return the result as a hex-encoded string.
|
3323
3323
|
* const string = 'Node.js';
|
@@ -4034,7 +4034,7 @@ declare module "crypto" {
|
|
4034
4034
|
saltLength: number;
|
4035
4035
|
}
|
4036
4036
|
/**
|
4037
|
-
*
|
4037
|
+
* Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
|
4038
4038
|
* `Crypto` is a singleton that provides access to the remainder of the crypto API.
|
4039
4039
|
* @since v15.0.0
|
4040
4040
|
*/
|
node/dns/promises.d.ts
CHANGED
@@ -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 `
|
4
|
+
* via `import { promises as dnsPromises } 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
|
-
*
|
63
|
+
* import dns from 'node:dns';
|
64
64
|
* const dnsPromises = dns.promises;
|
65
65
|
* const options = {
|
66
66
|
* family: 6,
|
@@ -96,7 +96,7 @@ 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
|
-
*
|
99
|
+
* import dnsPromises from 'node:dns';
|
100
100
|
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
101
101
|
* console.log(result.hostname, result.service);
|
102
102
|
* // Prints: localhost ssh
|
@@ -394,8 +394,8 @@ declare module "dns/promises" {
|
|
394
394
|
* other resolvers:
|
395
395
|
*
|
396
396
|
* ```js
|
397
|
-
*
|
398
|
-
* const resolver = new Resolver();
|
397
|
+
* import { promises } from 'node:dns';
|
398
|
+
* const resolver = new promises.Resolver();
|
399
399
|
* resolver.setServers(['4.4.4.4']);
|
400
400
|
*
|
401
401
|
* // This request will use the server at 4.4.4.4, independent of global settings.
|
node/dns.d.ts
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
* system do, use {@link lookup}.
|
10
10
|
*
|
11
11
|
* ```js
|
12
|
-
*
|
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
|
-
*
|
26
|
+
* import dns from 'node:dns';
|
27
27
|
*
|
28
28
|
* dns.resolve4('archive.org', (err, addresses) => {
|
29
29
|
* if (err) throw err;
|
@@ -139,7 +139,7 @@ declare module "dns" {
|
|
139
139
|
* Example usage:
|
140
140
|
*
|
141
141
|
* ```js
|
142
|
-
*
|
142
|
+
* import dns from 'node:dns';
|
143
143
|
* const options = {
|
144
144
|
* family: 6,
|
145
145
|
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
@@ -199,7 +199,7 @@ declare module "dns" {
|
|
199
199
|
* where `err.code` is the error code.
|
200
200
|
*
|
201
201
|
* ```js
|
202
|
-
*
|
202
|
+
* import dns from 'node:dns';
|
203
203
|
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
204
204
|
* console.log(hostname, service);
|
205
205
|
* // Prints: localhost ssh
|
@@ -787,7 +787,7 @@ declare module "dns" {
|
|
787
787
|
* other resolvers:
|
788
788
|
*
|
789
789
|
* ```js
|
790
|
-
*
|
790
|
+
* import { Resolver } from 'node:dns';
|
791
791
|
* const resolver = new Resolver();
|
792
792
|
* resolver.setServers(['4.4.4.4']);
|
793
793
|
*
|
node/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
|
-
*
|
67
|
-
*
|
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/fs/promises.d.ts
CHANGED
@@ -932,7 +932,7 @@ declare module "fs/promises" {
|
|
932
932
|
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
933
933
|
* 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
|
934
934
|
* platform-specific path separator
|
935
|
-
* (`
|
935
|
+
* (`import { sep } from 'node:path'`).
|
936
936
|
* @since v10.0.0
|
937
937
|
* @return Fulfills with a string containing the file system path of the newly created temporary directory.
|
938
938
|
*/
|
@@ -1174,7 +1174,7 @@ declare module "fs/promises" {
|
|
1174
1174
|
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
1175
1175
|
*
|
1176
1176
|
* ```js
|
1177
|
-
*
|
1177
|
+
* import { watch } from 'node:fs/promises';
|
1178
1178
|
*
|
1179
1179
|
* const ac = new AbortController();
|
1180
1180
|
* const { signal } = ac;
|
node/fs.d.ts
CHANGED
@@ -1900,7 +1900,7 @@ declare module "fs" {
|
|
1900
1900
|
* The `fs.mkdtemp()` method will append the six randomly selected characters
|
1901
1901
|
* directly to the `prefix` string. For instance, given a directory `/tmp`, if the
|
1902
1902
|
* intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator
|
1903
|
-
* (`
|
1903
|
+
* (`import { sep } from 'node:path'`).
|
1904
1904
|
*
|
1905
1905
|
* ```js
|
1906
1906
|
* import { tmpdir } from 'node:os';
|
@@ -3156,7 +3156,7 @@ declare module "fs" {
|
|
3156
3156
|
* stat object:
|
3157
3157
|
*
|
3158
3158
|
* ```js
|
3159
|
-
* import { watchFile } from 'fs';
|
3159
|
+
* import { watchFile } from 'node:fs';
|
3160
3160
|
*
|
3161
3161
|
* watchFile('message.text', (curr, prev) => {
|
3162
3162
|
* console.log(`the current mtime is: ${curr.mtime}`);
|
node/http.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* To use the HTTP server and client one must `
|
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
|
-
*
|
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)
|