Skip to content

Commit 83c2a14

Browse files
TrottBethGriggs
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 621099e commit 83c2a14

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
@@ -860,8 +860,10 @@ changes:
860860
* `output` {Array} Array of results from stdio output.
861861
* `stdout` {Buffer|string} The contents of `output[1]`.
862862
* `stderr` {Buffer|string} The contents of `output[2]`.
863-
* `status` {number} The exit code of the child process.
864-
* `signal` {string} The signal used to kill the child process.
863+
* `status` {number|null} The exit code of the subprocess, or `null` if the
864+
subprocess terminated due to a signal.
865+
* `signal` {string|null} The signal used to kill the subprocess, or `null` if
866+
the subprocess did not terminate due to a signal.
865867
* `error` {Error} The error object if the child process failed or timed out.
866868

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

0 commit comments

Comments
 (0)