Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update spawnSync() status value possibilities #26680

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,8 @@ changes:
* `output` {Array} Array of results from stdio output.
* `stdout` {Buffer|string} The contents of `output[1]`.
* `stderr` {Buffer|string} The contents of `output[2]`.
* `status` {number} The exit code of the child process.
* `status` {number|null} The exit code of the subprocess, or `null` if the
child process exited due to a signal.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"exited due to a signal" --> "terminated due to a signal" (if it terminated due to a signal, it didn't exit, which is why there is no exit code).

the signal docs below have the same problem, they should be changed to something like

The signal that terminated the child process, or null if the child process exited.

(or "if the child process terminated due to exiting.", but that is maybe too verbose).

Perhaps its obvious from the above, but you may want to emphasize that either status will be non-null, or signal will be non-null, but they will NEVER both have non-null values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sam-github OK, I think I've addressed this. I went with end due to signal instead of terminate due to signal. PTAL.

* `signal` {string} The signal used to kill the child process.
* `error` {Error} The error object if the child process failed or timed out.

Expand Down