Skip to content

Commit 3299de8

Browse files
HarshithaKPTrott
authored andcommitted
doc: document missing properties in child_process
Add documentation for subprocess.exitCode, subprocess.signalCode, subprocess.spawnargs, and subprocess.spawnfile. PR-URL: #31342 Fixes: #27206 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 9bfa4a9 commit 3299de8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/api/child_process.md

+35
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,13 @@ When the child process is a Node.js instance (e.g. spawned using
10751075
[`child_process.fork()`][]), the `process.disconnect()` method can be invoked
10761076
within the child process to close the IPC channel as well.
10771077

1078+
### `subprocess.exitCode`
1079+
1080+
* {integer}
1081+
1082+
The `subprocess.exitcode` property indicates the exit code of the child process.
1083+
If the child process is still running, the field will be null.
1084+
10781085
### `subprocess.kill([signal])`
10791086
<!-- YAML
10801087
added: v0.1.90
@@ -1368,6 +1375,34 @@ It is also recommended that any `'message'` handlers in the child process
13681375
verify that `socket` exists, as the connection may have been closed during the
13691376
time it takes to send the connection to the child.
13701377

1378+
### `subprocess.signalCode`
1379+
1380+
* {integer}
1381+
1382+
The `subprocess.signalCode` property indicates the signal number received by
1383+
the child process if any, else null.
1384+
1385+
### `subprocess.spawnargs`
1386+
1387+
* {Array}
1388+
1389+
The `subprocess.spawnargs` property represents the full list of command line
1390+
arguments the child process was launched with.
1391+
1392+
### `subprocess.spawnfile`
1393+
1394+
* {string}
1395+
1396+
The `subprocess.spawnfile` property indicates the executable file name of
1397+
the child process that is launched.
1398+
1399+
For [`child_process.fork()`][], its value will be equal to
1400+
[`process.execPath`][].
1401+
For [`child_process.spawn()`][], its value will be the name of
1402+
the executable file.
1403+
For [`child_process.exec()`][], its value will be the name of the shell
1404+
in which the child process is launched.
1405+
13711406
### `subprocess.stderr`
13721407
<!-- YAML
13731408
added: v0.1.90

0 commit comments

Comments
 (0)