@rio-cloud/cdk-v2-constructs 8.2.0 → 8.2.1-alpha.0

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.
Files changed (179) hide show
  1. package/.jsii +2 -2
  2. package/node_modules/@types/node/README.md +3 -3
  3. package/node_modules/@types/node/assert/strict.d.ts +105 -2
  4. package/node_modules/@types/node/assert.d.ts +211 -92
  5. package/node_modules/@types/node/async_hooks.d.ts +103 -19
  6. package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  7. package/node_modules/@types/node/buffer.d.ts +88 -516
  8. package/node_modules/@types/node/child_process.d.ts +167 -231
  9. package/node_modules/@types/node/cluster.d.ts +172 -26
  10. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  11. package/node_modules/@types/node/console.d.ts +66 -28
  12. package/node_modules/@types/node/constants.d.ts +14 -12
  13. package/node_modules/@types/node/crypto.d.ts +1458 -497
  14. package/node_modules/@types/node/dgram.d.ts +44 -30
  15. package/node_modules/@types/node/diagnostics_channel.d.ts +389 -4
  16. package/node_modules/@types/node/dns/promises.d.ts +120 -42
  17. package/node_modules/@types/node/dns.d.ts +209 -95
  18. package/node_modules/@types/node/domain.d.ts +14 -18
  19. package/node_modules/@types/node/events.d.ts +245 -113
  20. package/node_modules/@types/node/fs/promises.d.ts +194 -96
  21. package/node_modules/@types/node/fs.d.ts +695 -270
  22. package/node_modules/@types/node/globals.d.ts +97 -308
  23. package/node_modules/@types/node/globals.typedarray.d.ts +41 -0
  24. package/node_modules/@types/node/http.d.ts +363 -97
  25. package/node_modules/@types/node/http2.d.ts +684 -231
  26. package/node_modules/@types/node/https.d.ts +122 -87
  27. package/node_modules/@types/node/index.d.ts +24 -11
  28. package/node_modules/@types/node/inspector.d.ts +220 -2690
  29. package/node_modules/@types/node/inspector.generated.d.ts +4239 -0
  30. package/node_modules/@types/node/module.d.ts +705 -149
  31. package/node_modules/@types/node/net.d.ts +178 -54
  32. package/node_modules/@types/node/os.d.ts +47 -17
  33. package/node_modules/@types/node/package.json +22 -97
  34. package/node_modules/@types/node/path.d.ts +12 -3
  35. package/node_modules/@types/node/perf_hooks.d.ts +500 -97
  36. package/node_modules/@types/node/process.d.ts +657 -87
  37. package/node_modules/@types/node/punycode.d.ts +5 -5
  38. package/node_modules/@types/node/querystring.d.ts +24 -13
  39. package/node_modules/@types/node/readline/promises.d.ts +25 -14
  40. package/node_modules/@types/node/readline.d.ts +102 -41
  41. package/node_modules/@types/node/repl.d.ts +38 -30
  42. package/node_modules/@types/node/sea.d.ts +162 -0
  43. package/node_modules/@types/node/sqlite.d.ts +1040 -0
  44. package/node_modules/@types/node/stream/consumers.d.ts +33 -7
  45. package/node_modules/@types/node/stream/promises.d.ts +8 -1
  46. package/node_modules/@types/node/stream/web.d.ts +251 -28
  47. package/node_modules/@types/node/stream.d.ts +1060 -1055
  48. package/node_modules/@types/node/string_decoder.d.ts +8 -8
  49. package/node_modules/@types/node/test.d.ts +2133 -1166
  50. package/node_modules/@types/node/timers/promises.d.ts +31 -16
  51. package/node_modules/@types/node/timers.d.ts +159 -114
  52. package/node_modules/@types/node/tls.d.ts +232 -163
  53. package/node_modules/@types/node/trace_events.d.ts +43 -28
  54. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  55. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  56. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  57. package/node_modules/@types/node/ts5.6/index.d.ts +103 -0
  58. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  59. package/node_modules/@types/node/ts5.7/index.d.ts +103 -0
  60. package/node_modules/@types/node/tty.d.ts +9 -9
  61. package/node_modules/@types/node/url.d.ts +236 -84
  62. package/node_modules/@types/node/util.d.ts +562 -412
  63. package/node_modules/@types/node/v8.d.ts +368 -21
  64. package/node_modules/@types/node/vm.d.ts +443 -149
  65. package/node_modules/@types/node/wasi.d.ts +62 -18
  66. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  67. package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  68. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  69. package/node_modules/@types/node/web-globals/events.d.ts +97 -0
  70. package/node_modules/@types/node/web-globals/fetch.d.ts +62 -0
  71. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  72. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  73. package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  74. package/node_modules/@types/node/worker_threads.d.ts +310 -107
  75. package/node_modules/@types/node/zlib.d.ts +301 -73
  76. package/node_modules/undici-types/LICENSE +21 -0
  77. package/node_modules/undici-types/agent.d.ts +13 -12
  78. package/node_modules/undici-types/api.d.ts +26 -26
  79. package/node_modules/undici-types/balanced-pool.d.ts +19 -7
  80. package/node_modules/undici-types/cache-interceptor.d.ts +173 -0
  81. package/node_modules/undici-types/client-stats.d.ts +15 -0
  82. package/node_modules/undici-types/client.d.ts +26 -15
  83. package/node_modules/undici-types/connector.d.ts +2 -2
  84. package/node_modules/undici-types/cookies.d.ts +2 -0
  85. package/node_modules/undici-types/diagnostics-channel.d.ts +19 -12
  86. package/node_modules/undici-types/dispatcher.d.ts +148 -113
  87. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  88. package/node_modules/undici-types/errors.d.ts +79 -46
  89. package/node_modules/undici-types/eventsource.d.ts +66 -0
  90. package/node_modules/undici-types/fetch.d.ts +41 -39
  91. package/node_modules/undici-types/formdata.d.ts +8 -8
  92. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  93. package/node_modules/undici-types/global-origin.d.ts +5 -5
  94. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  95. package/node_modules/undici-types/handlers.d.ts +11 -5
  96. package/node_modules/undici-types/header.d.ts +157 -1
  97. package/node_modules/undici-types/index.d.ts +68 -43
  98. package/node_modules/undici-types/interceptors.d.ts +71 -3
  99. package/node_modules/undici-types/mock-agent.d.ts +36 -18
  100. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  101. package/node_modules/undici-types/mock-client.d.ts +6 -4
  102. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  103. package/node_modules/undici-types/mock-interceptor.d.ts +24 -23
  104. package/node_modules/undici-types/mock-pool.d.ts +6 -4
  105. package/node_modules/undici-types/package.json +1 -1
  106. package/node_modules/undici-types/patch.d.ts +0 -42
  107. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  108. package/node_modules/undici-types/pool.d.ts +21 -8
  109. package/node_modules/undici-types/proxy-agent.d.ts +5 -6
  110. package/node_modules/undici-types/readable.d.ts +24 -17
  111. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  112. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  113. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  114. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  115. package/node_modules/undici-types/util.d.ts +18 -0
  116. package/node_modules/undici-types/utility.d.ts +7 -0
  117. package/node_modules/undici-types/webidl.d.ts +157 -36
  118. package/node_modules/undici-types/websocket.d.ts +67 -12
  119. package/package.json +9 -60
  120. package/version.json +1 -1
  121. package/node_modules/@types/node/dom-events.d.ts +0 -122
  122. package/node_modules/@types/node/globals.global.d.ts +0 -1
  123. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  124. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  125. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  126. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  127. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  128. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  129. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  130. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  131. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4455
  132. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  133. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -191
  134. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  135. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  136. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  137. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  138. package/node_modules/@types/node/ts4.8/events.d.ts +0 -796
  139. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1232
  140. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4289
  141. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -381
  142. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  143. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1888
  144. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  145. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  146. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  147. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  148. package/node_modules/@types/node/ts4.8/module.d.ts +0 -287
  149. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  150. package/node_modules/@types/node/ts4.8/os.d.ts +0 -477
  151. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  152. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -639
  153. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1532
  154. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  155. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  156. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  157. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  158. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  159. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  160. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  161. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -350
  162. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  163. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  164. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1382
  165. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  166. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  167. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  168. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  169. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  170. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  171. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2186
  172. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -635
  173. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -901
  174. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  175. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  176. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  177. package/node_modules/argparse/CHANGELOG.md +0 -216
  178. package/node_modules/undici-types/file.d.ts +0 -39
  179. package/node_modules/undici-types/filereader.d.ts +0 -54
@@ -4,7 +4,8 @@
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
+ * import { once } from 'node:events';
8
9
  * const ls = spawn('ls', ['-lh', '/usr']);
9
10
  *
10
11
  * ls.stdout.on('data', (data) => {
@@ -15,17 +16,16 @@
15
16
  * console.error(`stderr: ${data}`);
16
17
  * });
17
18
  *
18
- * ls.on('close', (code) => {
19
- * console.log(`child process exited with code ${code}`);
20
- * });
19
+ * const [code] = await once(ls, 'close');
20
+ * console.log(`child process exited with code ${code}`);
21
21
  * ```
22
22
  *
23
23
  * By default, pipes for `stdin`, `stdout`, and `stderr` are established between
24
24
  * the parent Node.js process and the spawned subprocess. These pipes have
25
25
  * limited (and platform-specific) capacity. If the subprocess writes to
26
26
  * stdout in excess of that limit without the output being captured, the
27
- * subprocess blocks waiting for the pipe buffer to accept more data. This is
28
- * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
27
+ * subprocess blocks, waiting for the pipe buffer to accept more data. This is
28
+ * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
29
29
  *
30
30
  * The command lookup is performed using the `options.env.PATH` environment
31
31
  * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
@@ -38,7 +38,7 @@
38
38
  * lexicographically sorts the `env` keys and uses the first one that
39
39
  * case-insensitively matches. Only first (in lexicographic order) entry will be
40
40
  * passed to the subprocess. This might lead to issues on Windows when passing
41
- * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
41
+ * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`.
42
42
  *
43
43
  * The {@link spawn} method spawns the child process asynchronously,
44
44
  * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
@@ -63,16 +63,17 @@
63
63
  * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
64
64
  * the synchronous methods can have significant impact on performance due to
65
65
  * stalling the event loop while spawned processes complete.
66
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js)
66
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/child_process.js)
67
67
  */
68
68
  declare module "child_process" {
69
- import { ObjectEncodingOptions } from "node:fs";
69
+ import { NonSharedBuffer } from "node:buffer";
70
70
  import { Abortable, EventEmitter } from "node:events";
71
+ import * as dgram from "node:dgram";
71
72
  import * as net from "node:net";
72
- import { Pipe, Readable, Stream, Writable } from "node:stream";
73
+ import { Readable, Stream, Writable } from "node:stream";
73
74
  import { URL } from "node:url";
74
75
  type Serializable = string | object | number | boolean | bigint;
75
- type SendHandle = net.Socket | net.Server;
76
+ type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
76
77
  /**
77
78
  * Instances of the `ChildProcess` represent spawned child processes.
78
79
  *
@@ -94,7 +95,7 @@ declare module "child_process" {
94
95
  * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
95
96
  * refer to the same value.
96
97
  *
97
- * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned.
98
+ * The `subprocess.stdin` property can be `null` or `undefined` if the child process could not be successfully spawned.
98
99
  * @since v0.1.90
99
100
  */
100
101
  stdin: Writable | null;
@@ -108,7 +109,7 @@ declare module "child_process" {
108
109
  * refer to the same value.
109
110
  *
110
111
  * ```js
111
- * const { spawn } = require('node:child_process');
112
+ * import { spawn } from 'node:child_process';
112
113
  *
113
114
  * const subprocess = spawn('ls');
114
115
  *
@@ -117,7 +118,7 @@ declare module "child_process" {
117
118
  * });
118
119
  * ```
119
120
  *
120
- * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned.
121
+ * The `subprocess.stdout` property can be `null` or `undefined` if the child process could not be successfully spawned.
121
122
  * @since v0.1.90
122
123
  */
123
124
  stdout: Readable | null;
@@ -130,7 +131,7 @@ declare module "child_process" {
130
131
  * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
131
132
  * refer to the same value.
132
133
  *
133
- * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned.
134
+ * The `subprocess.stderr` property can be `null` or `undefined` if the child process could not be successfully spawned.
134
135
  * @since v0.1.90
135
136
  */
136
137
  stderr: Readable | null;
@@ -139,11 +140,11 @@ declare module "child_process" {
139
140
  * no IPC channel exists, this property is `undefined`.
140
141
  * @since v7.1.0
141
142
  */
142
- readonly channel?: Pipe | null | undefined;
143
+ readonly channel?: Control | null;
143
144
  /**
144
145
  * A sparse array of pipes to the child process, corresponding with positions in
145
146
  * the `stdio` option passed to {@link spawn} that have been set
146
- * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
147
+ * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`,
147
148
  * respectively.
148
149
  *
149
150
  * In the following example, only the child's fd `1` (stdout) is configured as a
@@ -151,9 +152,9 @@ declare module "child_process" {
151
152
  * in the array are `null`.
152
153
  *
153
154
  * ```js
154
- * const assert = require('node:assert');
155
- * const fs = require('node:fs');
156
- * 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';
157
158
  *
158
159
  * const subprocess = child_process.spawn('ls', {
159
160
  * stdio: [
@@ -201,7 +202,7 @@ declare module "child_process" {
201
202
  * emitted.
202
203
  *
203
204
  * ```js
204
- * const { spawn } = require('node:child_process');
205
+ * import { spawn } from 'node:child_process';
205
206
  * const grep = spawn('grep', ['ssh']);
206
207
  *
207
208
  * console.log(`Spawned child pid: ${grep.pid}`);
@@ -212,7 +213,7 @@ declare module "child_process" {
212
213
  readonly pid?: number | undefined;
213
214
  /**
214
215
  * The `subprocess.connected` property indicates whether it is still possible to
215
- * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
216
+ * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages.
216
217
  * @since v0.7.2
217
218
  */
218
219
  readonly connected: boolean;
@@ -248,7 +249,7 @@ declare module "child_process" {
248
249
  * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
249
250
  *
250
251
  * ```js
251
- * const { spawn } = require('node:child_process');
252
+ * import { spawn } from 'node:child_process';
252
253
  * const grep = spawn('grep', ['ssh']);
253
254
  *
254
255
  * grep.on('close', (code, signal) => {
@@ -272,7 +273,7 @@ declare module "child_process" {
272
273
  * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
273
274
  *
274
275
  * On Windows, where POSIX signals do not exist, the `signal` argument will be
275
- * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
276
+ * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`).
276
277
  * See `Signal Events` for more details.
277
278
  *
278
279
  * On Linux, child processes of child processes will not be terminated
@@ -281,7 +282,7 @@ declare module "child_process" {
281
282
  *
282
283
  * ```js
283
284
  * 'use strict';
284
- * const { spawn } = require('node:child_process');
285
+ * import { spawn } from 'node:child_process';
285
286
  *
286
287
  * const subprocess = spawn(
287
288
  * 'sh',
@@ -319,7 +320,7 @@ declare module "child_process" {
319
320
  * For example, in the parent script:
320
321
  *
321
322
  * ```js
322
- * const cp = require('node:child_process');
323
+ * import cp from 'node:child_process';
323
324
  * const n = cp.fork(`${__dirname}/sub.js`);
324
325
  *
325
326
  * n.on('message', (m) => {
@@ -346,20 +347,20 @@ declare module "child_process" {
346
347
  *
347
348
  * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
348
349
  * containing a `NODE_` prefix in the `cmd` property are reserved for use within
349
- * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
350
- * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
350
+ * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js.
351
+ * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice.
351
352
  *
352
353
  * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
353
354
  * for passing a TCP server or socket object to the child process. The child will
354
355
  * receive the object as the second argument passed to the callback function
355
- * registered on the `'message'` event. Any data that is received
356
- * and buffered in the socket will not be sent to the child.
356
+ * registered on the `'message'` event. Any data that is received and buffered in
357
+ * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows.
357
358
  *
358
359
  * The optional `callback` is a function that is invoked after the message is
359
360
  * sent but before the child may have received it. The function is called with a
360
361
  * single argument: `null` on success, or an `Error` object on failure.
361
362
  *
362
- * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
363
+ * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can
363
364
  * happen, for instance, when the child process has already exited.
364
365
  *
365
366
  * `subprocess.send()` will return `false` if the channel has closed or when the
@@ -373,10 +374,12 @@ declare module "child_process" {
373
374
  * a TCP server object to the child process as illustrated in the example below:
374
375
  *
375
376
  * ```js
376
- * const subprocess = require('node:child_process').fork('subprocess.js');
377
+ * import { createServer } from 'node:net';
378
+ * import { fork } from 'node:child_process';
379
+ * const subprocess = fork('subprocess.js');
377
380
  *
378
381
  * // Open up the server object and send the handle.
379
- * const server = require('node:net').createServer();
382
+ * const server = createServer();
380
383
  * server.on('connection', (socket) => {
381
384
  * socket.end('handled by parent');
382
385
  * });
@@ -400,8 +403,8 @@ declare module "child_process" {
400
403
  * Once the server is now shared between the parent and child, some connections
401
404
  * can be handled by the parent and some by the child.
402
405
  *
403
- * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of
404
- * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only
406
+ * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of
407
+ * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only
405
408
  * supported on Unix platforms.
406
409
  *
407
410
  * #### Example: sending a socket object
@@ -411,13 +414,14 @@ declare module "child_process" {
411
414
  * handle connections with "normal" or "special" priority:
412
415
  *
413
416
  * ```js
414
- * const { fork } = require('node:child_process');
417
+ * import { createServer } from 'node:net';
418
+ * import { fork } from 'node:child_process';
415
419
  * const normal = fork('subprocess.js', ['normal']);
416
420
  * const special = fork('subprocess.js', ['special']);
417
421
  *
418
422
  * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
419
423
  * // the sockets from being read before they are sent to the child process.
420
- * const server = require('node:net').createServer({ pauseOnConnect: true });
424
+ * const server = createServer({ pauseOnConnect: true });
421
425
  * server.on('connection', (socket) => {
422
426
  *
423
427
  * // If this is special priority...
@@ -454,6 +458,7 @@ declare module "child_process" {
454
458
  * as the connection may have been closed during the time it takes to send the
455
459
  * connection to the child.
456
460
  * @since v0.5.9
461
+ * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v24.x/api/dgram.html#class-dgramsocket) object.
457
462
  * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
458
463
  */
459
464
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
@@ -482,13 +487,13 @@ declare module "child_process" {
482
487
  disconnect(): void;
483
488
  /**
484
489
  * By default, the parent will wait for the detached child to exit. To prevent the
485
- * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
490
+ * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not
486
491
  * include the child in its reference count, allowing the parent to exit
487
492
  * independently of the child, unless there is an established IPC channel between
488
493
  * the child and the parent.
489
494
  *
490
495
  * ```js
491
- * const { spawn } = require('node:child_process');
496
+ * import { spawn } from 'node:child_process';
492
497
  *
493
498
  * const subprocess = spawn(process.argv[0], ['child_program.js'], {
494
499
  * detached: true,
@@ -506,7 +511,7 @@ declare module "child_process" {
506
511
  * to wait for the child to exit before exiting itself.
507
512
  *
508
513
  * ```js
509
- * const { spawn } = require('node:child_process');
514
+ * import { spawn } from 'node:child_process';
510
515
  *
511
516
  * const subprocess = spawn(process.argv[0], ['child_program.js'], {
512
517
  * detached: true,
@@ -608,6 +613,10 @@ declare module "child_process" {
608
613
  Readable | Writable | null | undefined, // extra, no modification
609
614
  ];
610
615
  }
616
+ interface Control extends EventEmitter {
617
+ ref(): void;
618
+ unref(): void;
619
+ }
611
620
  interface MessageOptions {
612
621
  keepOpen?: boolean | undefined;
613
622
  }
@@ -678,7 +687,7 @@ declare module "child_process" {
678
687
  stdio: [Stdin, Stdout, Stderr];
679
688
  }
680
689
  /**
681
- * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
690
+ * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults
682
691
  * to an empty array.
683
692
  *
684
693
  * **If the `shell` option is enabled, do not pass unsanitized user input to this**
@@ -709,7 +718,8 @@ declare module "child_process" {
709
718
  * exit code:
710
719
  *
711
720
  * ```js
712
- * const { spawn } = require('node:child_process');
721
+ * import { spawn } from 'node:child_process';
722
+ * import { once } from 'node:events';
713
723
  * const ls = spawn('ls', ['-lh', '/usr']);
714
724
  *
715
725
  * ls.stdout.on('data', (data) => {
@@ -720,15 +730,14 @@ declare module "child_process" {
720
730
  * console.error(`stderr: ${data}`);
721
731
  * });
722
732
  *
723
- * ls.on('close', (code) => {
724
- * console.log(`child process exited with code ${code}`);
725
- * });
733
+ * const [code] = await once(ls, 'close');
734
+ * console.log(`child process exited with code ${code}`);
726
735
  * ```
727
736
  *
728
737
  * Example: A very elaborate way to run `ps ax | grep ssh`
729
738
  *
730
739
  * ```js
731
- * const { spawn } = require('node:child_process');
740
+ * import { spawn } from 'node:child_process';
732
741
  * const ps = spawn('ps', ['ax']);
733
742
  * const grep = spawn('grep', ['ssh']);
734
743
  *
@@ -765,7 +774,7 @@ declare module "child_process" {
765
774
  * Example of checking for failed `spawn`:
766
775
  *
767
776
  * ```js
768
- * const { spawn } = require('node:child_process');
777
+ * import { spawn } from 'node:child_process';
769
778
  * const subprocess = spawn('bad_command');
770
779
  *
771
780
  * subprocess.on('error', (err) => {
@@ -776,14 +785,14 @@ declare module "child_process" {
776
785
  * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
777
786
  * title while others (Windows, SunOS) will use `command`.
778
787
  *
779
- * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve
780
- * it with the`process.argv0` property instead.
788
+ * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve
789
+ * it with the `process.argv0` property instead.
781
790
  *
782
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
791
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
783
792
  * the error passed to the callback will be an `AbortError`:
784
793
  *
785
794
  * ```js
786
- * const { spawn } = require('node:child_process');
795
+ * import { spawn } from 'node:child_process';
787
796
  * const controller = new AbortController();
788
797
  * const { signal } = controller;
789
798
  * const grep = spawn('grep', ['ssh'], { signal });
@@ -882,18 +891,22 @@ declare module "child_process" {
882
891
  signal?: AbortSignal | undefined;
883
892
  maxBuffer?: number | undefined;
884
893
  killSignal?: NodeJS.Signals | number | undefined;
894
+ encoding?: string | null | undefined;
885
895
  }
886
896
  interface ExecOptionsWithStringEncoding extends ExecOptions {
887
- encoding: BufferEncoding;
897
+ encoding?: BufferEncoding | undefined;
888
898
  }
889
899
  interface ExecOptionsWithBufferEncoding extends ExecOptions {
890
- encoding: BufferEncoding | null; // specify `null`.
900
+ encoding: "buffer" | null; // specify `null`.
891
901
  }
902
+ // TODO: Just Plain Wrong™ (see also nodejs/node#57392)
892
903
  interface ExecException extends Error {
893
- cmd?: string | undefined;
894
- killed?: boolean | undefined;
895
- code?: number | undefined;
896
- signal?: NodeJS.Signals | undefined;
904
+ cmd?: string;
905
+ killed?: boolean;
906
+ code?: number;
907
+ signal?: NodeJS.Signals;
908
+ stdout?: string;
909
+ stderr?: string;
897
910
  }
898
911
  /**
899
912
  * Spawns a shell then executes the `command` within that shell, buffering any
@@ -902,7 +915,7 @@ declare module "child_process" {
902
915
  * need to be dealt with accordingly:
903
916
  *
904
917
  * ```js
905
- * const { exec } = require('node:child_process');
918
+ * import { exec } from 'node:child_process';
906
919
  *
907
920
  * exec('"/path/to/test file/test.sh" arg1 arg2');
908
921
  * // Double quotes are used so that the space in the path is not interpreted as
@@ -915,9 +928,9 @@ declare module "child_process" {
915
928
  * **Never pass unsanitized user input to this function. Any input containing shell**
916
929
  * **metacharacters may be used to trigger arbitrary command execution.**
917
930
  *
918
- * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The
931
+ * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The
919
932
  * `error.code` property will be
920
- * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the
933
+ * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the
921
934
  * process.
922
935
  *
923
936
  * The `stdout` and `stderr` arguments passed to the callback will contain the
@@ -928,7 +941,7 @@ declare module "child_process" {
928
941
  * encoding, `Buffer` objects will be passed to the callback instead.
929
942
  *
930
943
  * ```js
931
- * const { exec } = require('node:child_process');
944
+ * import { exec } from 'node:child_process';
932
945
  * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
933
946
  * if (error) {
934
947
  * console.error(`exec error: ${error}`);
@@ -947,14 +960,15 @@ declare module "child_process" {
947
960
  * the existing process and uses a shell to execute the command.
948
961
  *
949
962
  * If this method is invoked as its `util.promisify()` ed version, it returns
950
- * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
963
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In
951
964
  * case of an error (including any error resulting in an exit code other than 0), a
952
965
  * rejected promise is returned, with the same `error` object given in the
953
966
  * callback, but with two additional properties `stdout` and `stderr`.
954
967
  *
955
968
  * ```js
956
- * const util = require('node:util');
957
- * const exec = util.promisify(require('node:child_process').exec);
969
+ * import util from 'node:util';
970
+ * import child_process from 'node:child_process';
971
+ * const exec = util.promisify(child_process.exec);
958
972
  *
959
973
  * async function lsExample() {
960
974
  * const { stdout, stderr } = await exec('ls');
@@ -964,11 +978,11 @@ declare module "child_process" {
964
978
  * lsExample();
965
979
  * ```
966
980
  *
967
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
981
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
968
982
  * the error passed to the callback will be an `AbortError`:
969
983
  *
970
984
  * ```js
971
- * const { exec } = require('node:child_process');
985
+ * import { exec } from 'node:child_process';
972
986
  * const controller = new AbortController();
973
987
  * const { signal } = controller;
974
988
  * const child = exec('grep ssh', { signal }, (error) => {
@@ -987,39 +1001,24 @@ declare module "child_process" {
987
1001
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
988
1002
  function exec(
989
1003
  command: string,
990
- options: {
991
- encoding: "buffer" | null;
992
- } & ExecOptions,
993
- callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
1004
+ options: ExecOptionsWithBufferEncoding,
1005
+ callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
994
1006
  ): ChildProcess;
995
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1007
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
996
1008
  function exec(
997
1009
  command: string,
998
- options: {
999
- encoding: BufferEncoding;
1000
- } & ExecOptions,
1001
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1002
- ): ChildProcess;
1003
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1004
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1005
- function exec(
1006
- command: string,
1007
- options: {
1008
- encoding: BufferEncoding;
1009
- } & ExecOptions,
1010
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1011
- ): ChildProcess;
1012
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1013
- function exec(
1014
- command: string,
1015
- options: ExecOptions,
1010
+ options: ExecOptionsWithStringEncoding,
1016
1011
  callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1017
1012
  ): ChildProcess;
1018
1013
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1019
1014
  function exec(
1020
1015
  command: string,
1021
- options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
1022
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1016
+ options: ExecOptions | undefined | null,
1017
+ callback?: (
1018
+ error: ExecException | null,
1019
+ stdout: string | NonSharedBuffer,
1020
+ stderr: string | NonSharedBuffer,
1021
+ ) => void,
1023
1022
  ): ChildProcess;
1024
1023
  interface PromiseWithChild<T> extends Promise<T> {
1025
1024
  child: ChildProcess;
@@ -1031,35 +1030,24 @@ declare module "child_process" {
1031
1030
  }>;
1032
1031
  function __promisify__(
1033
1032
  command: string,
1034
- options: {
1035
- encoding: "buffer" | null;
1036
- } & ExecOptions,
1037
- ): PromiseWithChild<{
1038
- stdout: Buffer;
1039
- stderr: Buffer;
1040
- }>;
1041
- function __promisify__(
1042
- command: string,
1043
- options: {
1044
- encoding: BufferEncoding;
1045
- } & ExecOptions,
1033
+ options: ExecOptionsWithBufferEncoding,
1046
1034
  ): PromiseWithChild<{
1047
- stdout: string;
1048
- stderr: string;
1035
+ stdout: NonSharedBuffer;
1036
+ stderr: NonSharedBuffer;
1049
1037
  }>;
1050
1038
  function __promisify__(
1051
1039
  command: string,
1052
- options: ExecOptions,
1040
+ options: ExecOptionsWithStringEncoding,
1053
1041
  ): PromiseWithChild<{
1054
1042
  stdout: string;
1055
1043
  stderr: string;
1056
1044
  }>;
1057
1045
  function __promisify__(
1058
1046
  command: string,
1059
- options?: (ObjectEncodingOptions & ExecOptions) | null,
1047
+ options: ExecOptions | undefined | null,
1060
1048
  ): PromiseWithChild<{
1061
- stdout: string | Buffer;
1062
- stderr: string | Buffer;
1049
+ stdout: string | NonSharedBuffer;
1050
+ stderr: string | NonSharedBuffer;
1063
1051
  }>;
1064
1052
  }
1065
1053
  interface ExecFileOptions extends CommonOptions, Abortable {
@@ -1068,20 +1056,21 @@ declare module "child_process" {
1068
1056
  windowsVerbatimArguments?: boolean | undefined;
1069
1057
  shell?: boolean | string | undefined;
1070
1058
  signal?: AbortSignal | undefined;
1059
+ encoding?: string | null | undefined;
1071
1060
  }
1072
1061
  interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
1073
- encoding: BufferEncoding;
1062
+ encoding?: BufferEncoding | undefined;
1074
1063
  }
1075
1064
  interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
1076
1065
  encoding: "buffer" | null;
1077
1066
  }
1078
- interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
1079
- encoding: BufferEncoding;
1080
- }
1067
+ /** @deprecated Use `ExecFileOptions` instead. */
1068
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
1069
+ // TODO: execFile exceptions can take many forms... this accurately describes none of them
1081
1070
  type ExecFileException =
1082
1071
  & Omit<ExecException, "code">
1083
1072
  & Omit<NodeJS.ErrnoException, "code">
1084
- & { code?: string | number | undefined | null };
1073
+ & { code?: string | number | null };
1085
1074
  /**
1086
1075
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
1087
1076
  * executable `file` is spawned directly as a new process making it slightly more
@@ -1092,7 +1081,7 @@ declare module "child_process" {
1092
1081
  * supported.
1093
1082
  *
1094
1083
  * ```js
1095
- * const { execFile } = require('node:child_process');
1084
+ * import { execFile } from 'node:child_process';
1096
1085
  * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
1097
1086
  * if (error) {
1098
1087
  * throw error;
@@ -1109,14 +1098,15 @@ declare module "child_process" {
1109
1098
  * encoding, `Buffer` objects will be passed to the callback instead.
1110
1099
  *
1111
1100
  * If this method is invoked as its `util.promisify()` ed version, it returns
1112
- * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
1101
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In
1113
1102
  * case of an error (including any error resulting in an exit code other than 0), a
1114
1103
  * rejected promise is returned, with the same `error` object given in the
1115
1104
  * callback, but with two additional properties `stdout` and `stderr`.
1116
1105
  *
1117
1106
  * ```js
1118
- * const util = require('node:util');
1119
- * const execFile = util.promisify(require('node:child_process').execFile);
1107
+ * import util from 'node:util';
1108
+ * import child_process from 'node:child_process';
1109
+ * const execFile = util.promisify(child_process.execFile);
1120
1110
  * async function getVersion() {
1121
1111
  * const { stdout } = await execFile('node', ['--version']);
1122
1112
  * console.log(stdout);
@@ -1128,11 +1118,11 @@ declare module "child_process" {
1128
1118
  * **function. Any input containing shell metacharacters may be used to trigger**
1129
1119
  * **arbitrary command execution.**
1130
1120
  *
1131
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
1121
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
1132
1122
  * the error passed to the callback will be an `AbortError`:
1133
1123
  *
1134
1124
  * ```js
1135
- * const { execFile } = require('node:child_process');
1125
+ * import { execFile } from 'node:child_process';
1136
1126
  * const controller = new AbortController();
1137
1127
  * const { signal } = controller;
1138
1128
  * const child = execFile('node', ['--version'], { signal }, (error) => {
@@ -1145,91 +1135,63 @@ declare module "child_process" {
1145
1135
  * @param args List of string arguments.
1146
1136
  * @param callback Called with the output when process terminates.
1147
1137
  */
1148
- function execFile(file: string): ChildProcess;
1149
- function execFile(
1150
- file: string,
1151
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1152
- ): ChildProcess;
1153
- function execFile(file: string, args?: readonly string[] | null): ChildProcess;
1154
- function execFile(
1155
- file: string,
1156
- args: readonly string[] | undefined | null,
1157
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1158
- ): ChildProcess;
1159
1138
  // no `options` definitely means stdout/stderr are `string`.
1160
1139
  function execFile(
1161
1140
  file: string,
1162
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1141
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1163
1142
  ): ChildProcess;
1164
1143
  function execFile(
1165
1144
  file: string,
1166
1145
  args: readonly string[] | undefined | null,
1167
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1146
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1168
1147
  ): ChildProcess;
1169
1148
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
1170
1149
  function execFile(
1171
1150
  file: string,
1172
1151
  options: ExecFileOptionsWithBufferEncoding,
1173
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1152
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1174
1153
  ): ChildProcess;
1175
1154
  function execFile(
1176
1155
  file: string,
1177
1156
  args: readonly string[] | undefined | null,
1178
1157
  options: ExecFileOptionsWithBufferEncoding,
1179
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1158
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1180
1159
  ): ChildProcess;
1181
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1160
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1182
1161
  function execFile(
1183
1162
  file: string,
1184
1163
  options: ExecFileOptionsWithStringEncoding,
1185
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1164
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1186
1165
  ): ChildProcess;
1187
1166
  function execFile(
1188
1167
  file: string,
1189
1168
  args: readonly string[] | undefined | null,
1190
1169
  options: ExecFileOptionsWithStringEncoding,
1191
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1192
- ): ChildProcess;
1193
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1194
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1195
- function execFile(
1196
- file: string,
1197
- options: ExecFileOptionsWithOtherEncoding,
1198
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1199
- ): ChildProcess;
1200
- function execFile(
1201
- file: string,
1202
- args: readonly string[] | undefined | null,
1203
- options: ExecFileOptionsWithOtherEncoding,
1204
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1205
- ): ChildProcess;
1206
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1207
- function execFile(
1208
- file: string,
1209
- options: ExecFileOptions,
1210
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1211
- ): ChildProcess;
1212
- function execFile(
1213
- file: string,
1214
- args: readonly string[] | undefined | null,
1215
- options: ExecFileOptions,
1216
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1170
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1217
1171
  ): ChildProcess;
1218
1172
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1219
1173
  function execFile(
1220
1174
  file: string,
1221
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1175
+ options: ExecFileOptions | undefined | null,
1222
1176
  callback:
1223
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1177
+ | ((
1178
+ error: ExecFileException | null,
1179
+ stdout: string | NonSharedBuffer,
1180
+ stderr: string | NonSharedBuffer,
1181
+ ) => void)
1224
1182
  | undefined
1225
1183
  | null,
1226
1184
  ): ChildProcess;
1227
1185
  function execFile(
1228
1186
  file: string,
1229
1187
  args: readonly string[] | undefined | null,
1230
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1188
+ options: ExecFileOptions | undefined | null,
1231
1189
  callback:
1232
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1190
+ | ((
1191
+ error: ExecFileException | null,
1192
+ stdout: string | NonSharedBuffer,
1193
+ stderr: string | NonSharedBuffer,
1194
+ ) => void)
1233
1195
  | undefined
1234
1196
  | null,
1235
1197
  ): ChildProcess;
@@ -1249,16 +1211,16 @@ declare module "child_process" {
1249
1211
  file: string,
1250
1212
  options: ExecFileOptionsWithBufferEncoding,
1251
1213
  ): PromiseWithChild<{
1252
- stdout: Buffer;
1253
- stderr: Buffer;
1214
+ stdout: NonSharedBuffer;
1215
+ stderr: NonSharedBuffer;
1254
1216
  }>;
1255
1217
  function __promisify__(
1256
1218
  file: string,
1257
1219
  args: readonly string[] | undefined | null,
1258
1220
  options: ExecFileOptionsWithBufferEncoding,
1259
1221
  ): PromiseWithChild<{
1260
- stdout: Buffer;
1261
- stderr: Buffer;
1222
+ stdout: NonSharedBuffer;
1223
+ stderr: NonSharedBuffer;
1262
1224
  }>;
1263
1225
  function __promisify__(
1264
1226
  file: string,
@@ -1277,48 +1239,18 @@ declare module "child_process" {
1277
1239
  }>;
1278
1240
  function __promisify__(
1279
1241
  file: string,
1280
- options: ExecFileOptionsWithOtherEncoding,
1281
- ): PromiseWithChild<{
1282
- stdout: string | Buffer;
1283
- stderr: string | Buffer;
1284
- }>;
1285
- function __promisify__(
1286
- file: string,
1287
- args: readonly string[] | undefined | null,
1288
- options: ExecFileOptionsWithOtherEncoding,
1289
- ): PromiseWithChild<{
1290
- stdout: string | Buffer;
1291
- stderr: string | Buffer;
1292
- }>;
1293
- function __promisify__(
1294
- file: string,
1295
- options: ExecFileOptions,
1296
- ): PromiseWithChild<{
1297
- stdout: string;
1298
- stderr: string;
1299
- }>;
1300
- function __promisify__(
1301
- file: string,
1302
- args: readonly string[] | undefined | null,
1303
- options: ExecFileOptions,
1242
+ options: ExecFileOptions | undefined | null,
1304
1243
  ): PromiseWithChild<{
1305
- stdout: string;
1306
- stderr: string;
1307
- }>;
1308
- function __promisify__(
1309
- file: string,
1310
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1311
- ): PromiseWithChild<{
1312
- stdout: string | Buffer;
1313
- stderr: string | Buffer;
1244
+ stdout: string | NonSharedBuffer;
1245
+ stderr: string | NonSharedBuffer;
1314
1246
  }>;
1315
1247
  function __promisify__(
1316
1248
  file: string,
1317
1249
  args: readonly string[] | undefined | null,
1318
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1250
+ options: ExecFileOptions | undefined | null,
1319
1251
  ): PromiseWithChild<{
1320
- stdout: string | Buffer;
1321
- stderr: string | Buffer;
1252
+ stdout: string | NonSharedBuffer;
1253
+ stderr: string | NonSharedBuffer;
1322
1254
  }>;
1323
1255
  }
1324
1256
  interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
@@ -1352,7 +1284,7 @@ declare module "child_process" {
1352
1284
  * required, spawning a large number of child Node.js processes is not
1353
1285
  * recommended.
1354
1286
  *
1355
- * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative
1287
+ * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative
1356
1288
  * execution path to be used.
1357
1289
  *
1358
1290
  * Node.js processes launched with a custom `execPath` will communicate with the
@@ -1362,9 +1294,9 @@ declare module "child_process" {
1362
1294
  * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
1363
1295
  * current process.
1364
1296
  *
1365
- * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
1297
+ * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set.
1366
1298
  *
1367
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
1299
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except
1368
1300
  * the error passed to the callback will be an `AbortError`:
1369
1301
  *
1370
1302
  * ```js
@@ -1373,7 +1305,7 @@ declare module "child_process" {
1373
1305
  * console.log(`Hello from ${process.argv[2]}!`);
1374
1306
  * }, 1_000);
1375
1307
  * } else {
1376
- * const { fork } = require('node:child_process');
1308
+ * import { fork } from 'node:child_process';
1377
1309
  * const controller = new AbortController();
1378
1310
  * const { signal } = controller;
1379
1311
  * const child = fork(__filename, ['child'], { signal });
@@ -1387,8 +1319,8 @@ declare module "child_process" {
1387
1319
  * @param modulePath The module to run in the child.
1388
1320
  * @param args List of string arguments.
1389
1321
  */
1390
- function fork(modulePath: string, options?: ForkOptions): ChildProcess;
1391
- function fork(modulePath: string, args?: readonly string[], options?: ForkOptions): ChildProcess;
1322
+ function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess;
1323
+ function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess;
1392
1324
  interface SpawnSyncOptions extends CommonSpawnOptions {
1393
1325
  input?: string | NodeJS.ArrayBufferView | undefined;
1394
1326
  maxBuffer?: number | undefined;
@@ -1407,7 +1339,7 @@ declare module "child_process" {
1407
1339
  stderr: T;
1408
1340
  status: number | null;
1409
1341
  signal: NodeJS.Signals | null;
1410
- error?: Error | undefined;
1342
+ error?: Error;
1411
1343
  }
1412
1344
  /**
1413
1345
  * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
@@ -1424,11 +1356,11 @@ declare module "child_process" {
1424
1356
  * @param command The command to run.
1425
1357
  * @param args List of string arguments.
1426
1358
  */
1427
- function spawnSync(command: string): SpawnSyncReturns<Buffer>;
1359
+ function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
1428
1360
  function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1429
- function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1430
- function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1431
- function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<Buffer>;
1361
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<NonSharedBuffer>;
1362
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | NonSharedBuffer>;
1363
+ function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<NonSharedBuffer>;
1432
1364
  function spawnSync(
1433
1365
  command: string,
1434
1366
  args: readonly string[],
@@ -1438,12 +1370,12 @@ declare module "child_process" {
1438
1370
  command: string,
1439
1371
  args: readonly string[],
1440
1372
  options: SpawnSyncOptionsWithBufferEncoding,
1441
- ): SpawnSyncReturns<Buffer>;
1373
+ ): SpawnSyncReturns<NonSharedBuffer>;
1442
1374
  function spawnSync(
1443
1375
  command: string,
1444
1376
  args?: readonly string[],
1445
1377
  options?: SpawnSyncOptions,
1446
- ): SpawnSyncReturns<string | Buffer>;
1378
+ ): SpawnSyncReturns<string | NonSharedBuffer>;
1447
1379
  interface CommonExecOptions extends CommonOptions {
1448
1380
  input?: string | NodeJS.ArrayBufferView | undefined;
1449
1381
  /**
@@ -1473,7 +1405,7 @@ declare module "child_process" {
1473
1405
  * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
1474
1406
  * until the child process has fully closed. When a timeout has been encountered
1475
1407
  * and `killSignal` is sent, the method won't return until the process has
1476
- * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process
1408
+ * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process
1477
1409
  * has exited.
1478
1410
  *
1479
1411
  * If the process times out or has a non-zero exit code, this method will throw.
@@ -1485,10 +1417,10 @@ declare module "child_process" {
1485
1417
  * @param command The command to run.
1486
1418
  * @return The stdout from the command.
1487
1419
  */
1488
- function execSync(command: string): Buffer;
1420
+ function execSync(command: string): NonSharedBuffer;
1489
1421
  function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
1490
- function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
1491
- function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
1422
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer;
1423
+ function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer;
1492
1424
  interface ExecFileSyncOptions extends CommonExecOptions {
1493
1425
  shell?: boolean | string | undefined;
1494
1426
  }
@@ -1496,7 +1428,7 @@ declare module "child_process" {
1496
1428
  encoding: BufferEncoding;
1497
1429
  }
1498
1430
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
1499
- encoding?: "buffer" | null; // specify `null`.
1431
+ encoding?: "buffer" | null | undefined; // specify `null`.
1500
1432
  }
1501
1433
  /**
1502
1434
  * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
@@ -1518,11 +1450,11 @@ declare module "child_process" {
1518
1450
  * @param args List of string arguments.
1519
1451
  * @return The stdout from the command.
1520
1452
  */
1521
- function execFileSync(file: string): Buffer;
1453
+ function execFileSync(file: string): NonSharedBuffer;
1522
1454
  function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
1523
- function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1524
- function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
1525
- function execFileSync(file: string, args: readonly string[]): Buffer;
1455
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer;
1456
+ function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer;
1457
+ function execFileSync(file: string, args: readonly string[]): NonSharedBuffer;
1526
1458
  function execFileSync(
1527
1459
  file: string,
1528
1460
  args: readonly string[],
@@ -1532,8 +1464,12 @@ declare module "child_process" {
1532
1464
  file: string,
1533
1465
  args: readonly string[],
1534
1466
  options: ExecFileSyncOptionsWithBufferEncoding,
1535
- ): Buffer;
1536
- function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
1467
+ ): NonSharedBuffer;
1468
+ function execFileSync(
1469
+ file: string,
1470
+ args?: readonly string[],
1471
+ options?: ExecFileSyncOptions,
1472
+ ): string | NonSharedBuffer;
1537
1473
  }
1538
1474
  declare module "node:child_process" {
1539
1475
  export * from "child_process";