@@ -160,6 +160,8 @@ changes:
160
160
* ` shell ` {string} Shell to execute the command with. See
161
161
[ Shell requirements] [ ] and [ Default Windows shell] [ ] . ** Default:**
162
162
` '/bin/sh' ` on Unix, ` process.env.ComSpec ` on Windows.
163
+ * ` signal ` {AbortSignal} allows aborting the child process using an
164
+ AbortSignal.
163
165
* ` timeout ` {number} ** Default:** ` 0 `
164
166
* ` maxBuffer ` {number} Largest amount of data in bytes allowed on stdout or
165
167
stderr. If exceeded, the child process is terminated and any output is
@@ -246,6 +248,9 @@ async function lsExample() {
246
248
lsExample ();
247
249
```
248
250
251
+ The ` signal ` option works exactly the same way it does in
252
+ [ ` child_process.spawn() ` ] [ ] .
253
+
249
254
### ` child_process.execFile(file[, args][, options][, callback]) `
250
255
<!-- YAML
251
256
added: v0.1.91
@@ -280,7 +285,8 @@ changes:
280
285
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
281
286
shell can be specified as a string. See [ Shell requirements] [ ] and
282
287
[ Default Windows shell] [ ] . ** Default:** ` false ` (no shell).
283
- * ` signal ` {AbortSignal} allows aborting the execFile using an AbortSignal.
288
+ * ` signal ` {AbortSignal} allows aborting the child process using an
289
+ AbortSignal.
284
290
* ` callback ` {Function} Called with the output when process terminates.
285
291
* ` error ` {Error}
286
292
* ` stdout ` {string|Buffer}
@@ -334,18 +340,8 @@ getVersion();
334
340
function. Any input containing shell metacharacters may be used to trigger
335
341
arbitrary command execution.**
336
342
337
- If the ` signal ` option is enabled, calling ` .abort() ` on the corresponding
338
- ` AbortController ` is similar to calling ` .kill() ` on the child process except
339
- the error passed to the callback will be an ` AbortError ` :
340
-
341
- ``` js
342
- const controller = new AbortController ();
343
- const { signal } = controller;
344
- const child = execFile (' node' , [' --version' ], { signal }, (error ) => {
345
- console .log (error); // an AbortError
346
- });
347
- controller .abort ();
348
- ```
343
+ The ` signal ` option works exactly the same way it does in
344
+ [ ` child_process.spawn() ` ] [ ] .
349
345
350
346
### ` child_process.fork(modulePath[, args][, options]) `
351
347
<!-- YAML
@@ -385,7 +381,8 @@ changes:
385
381
* ` serialization ` {string} Specify the kind of serialization used for sending
386
382
messages between processes. Possible values are ` 'json' ` and ` 'advanced' ` .
387
383
See [ Advanced serialization] [ ] for more details. ** Default:** ` 'json' ` .
388
- * ` signal ` {AbortSignal} Allows closing the subprocess using an AbortSignal.
384
+ * ` signal ` {AbortSignal} Allows closing the child process using an
385
+ AbortSignal.
389
386
* ` killSignal ` {string} The signal value to be used when the spawned
390
387
process will be killed by the abort signal. ** Default:** ` 'SIGTERM' ` .
391
388
* ` silent ` {boolean} If ` true ` , stdin, stdout, and stderr of the child will be
@@ -484,7 +481,8 @@ changes:
484
481
when ` shell ` is specified and is CMD. ** Default:** ` false ` .
485
482
* ` windowsHide ` {boolean} Hide the subprocess console window that would
486
483
normally be created on Windows systems. ** Default:** ` false ` .
487
- * ` signal ` {AbortSignal} allows aborting the execFile using an AbortSignal.
484
+ * ` signal ` {AbortSignal} allows aborting the child process using an
485
+ AbortSignal.
488
486
* ` killSignal ` {string} The signal value to be used when the spawned
489
487
process will be killed by the abort signal. ** Default:** ` 'SIGTERM' ` .
490
488
0 commit comments