From 5fc6c1daed2ef41fda5147904ef8240a399f7943 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 15 Mar 2019 05:10:28 -0700 Subject: [PATCH] doc: update spawnSync() status value possibilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/26680 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani --- doc/api/child_process.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index a6064ee3c75..a3bdfc15c38 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -868,8 +868,10 @@ 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. - * `signal` {string} The signal used to kill the child process. + * `status` {number|null} The exit code of the subprocess, or `null` if the + subprocess terminated due to a signal. + * `signal` {string|null} The signal used to kill the subprocess, or `null` if + the subprocess did not terminate due to a signal. * `error` {Error} The error object if the child process failed or timed out. The `child_process.spawnSync()` method is generally identical to