Skip to content

Commit 0303aba

Browse files
Trotttargos
authored andcommitted
doc: update spawnSync() status value possibilities
The object returned by `child_process.spawnSync()` can have the `status` property set to `null` if the process terminated due to a signal. We even test for this in test/parallel/test-child-process-spawnsync-kill-signal.js. Update the documentation to reflect this. PR-URL: #26680 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
1 parent 54ffe61 commit 0303aba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/api/child_process.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,10 @@ changes:
868868
* `output` {Array} Array of results from stdio output.
869869
* `stdout` {Buffer|string} The contents of `output[1]`.
870870
* `stderr` {Buffer|string} The contents of `output[2]`.
871-
* `status` {number} The exit code of the child process.
872-
* `signal` {string} The signal used to kill the child process.
871+
* `status` {number|null} The exit code of the subprocess, or `null` if the
872+
subprocess terminated due to a signal.
873+
* `signal` {string|null} The signal used to kill the subprocess, or `null` if
874+
the subprocess did not terminate due to a signal.
873875
* `error` {Error} The error object if the child process failed or timed out.
874876

875877
The `child_process.spawnSync()` method is generally identical to

0 commit comments

Comments
 (0)