Skip to content

Commit b4d15a9

Browse files
HarshithaKPcodebytere
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 <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent de6d552 commit b4d15a9

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
@@ -1055,6 +1055,13 @@ When the child process is a Node.js instance (e.g. spawned using
10551055
[`child_process.fork()`][]), the `process.disconnect()` method can be invoked
10561056
within the child process to close the IPC channel as well.
10571057

1058+
### `subprocess.exitCode`
1059+
1060+
* {integer}
1061+
1062+
The `subprocess.exitcode` property indicates the exit code of the child process.
1063+
If the child process is still running, the field will be null.
1064+
10581065
### `subprocess.kill([signal])`
10591066
<!-- YAML
10601067
added: v0.1.90
@@ -1348,6 +1355,34 @@ It is also recommended that any `'message'` handlers in the child process
13481355
verify that `socket` exists, as the connection may have been closed during the
13491356
time it takes to send the connection to the child.
13501357

1358+
### `subprocess.signalCode`
1359+
1360+
* {integer}
1361+
1362+
The `subprocess.signalCode` property indicates the signal number received by
1363+
the child process if any, else null.
1364+
1365+
### `subprocess.spawnargs`
1366+
1367+
* {Array}
1368+
1369+
The `subprocess.spawnargs` property represents the full list of command line
1370+
arguments the child process was launched with.
1371+
1372+
### `subprocess.spawnfile`
1373+
1374+
* {string}
1375+
1376+
The `subprocess.spawnfile` property indicates the executable file name of
1377+
the child process that is launched.
1378+
1379+
For [`child_process.fork()`][], its value will be equal to
1380+
[`process.execPath`][].
1381+
For [`child_process.spawn()`][], its value will be the name of
1382+
the executable file.
1383+
For [`child_process.exec()`][], its value will be the name of the shell
1384+
in which the child process is launched.
1385+
13511386
### `subprocess.stderr`
13521387
<!-- YAML
13531388
added: v0.1.90

0 commit comments

Comments
 (0)