GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: explain child_process code and signal null values everywhere · nodejs/node@80cc17f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • child_process.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/child_process.md‎

Copy file name to clipboardExpand all lines: doc/api/child_process.md
+13-4Lines changed: 13 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1448,15 +1448,22 @@ instances of `ChildProcess`.
14481448
added: v0.7.7
14491449
-->
14501450
1451-
* `code` {number} The exit code if the child process exited on its own.
1452-
* `signal` {string} The signal by which the child process was terminated.
1451+
* `code` {number} The exit code if the child process exited on its own, or
1452+
`null` if the child process terminated due to a signal.
1453+
* `signal` {string} The signal by which the child process was terminated, or
1454+
`null` if the child process did not terminated due to a signal.
14531455
14541456
The `'close'` event is emitted after a process has ended _and_ the stdio
14551457
streams of a child process have been closed. This is distinct from the
14561458
[`'exit'`][] event, since multiple processes might share the same stdio
14571459
streams. The `'close'` event will always emit after [`'exit'`][] was
14581460
already emitted, or [`'error'`][] if the child process failed to spawn.
14591461
1462+
If the process exited, `code` is the final exit code of the process, otherwise
1463+
`null`. If the process terminated due to receipt of a signal, `signal` is the
1464+
string name of the signal, otherwise `null`. One of the two will always be
1465+
non-`null`.
1466+
14601467
```cjs
14611468
const { spawn } = require('node:child_process');
14621469
const ls = spawn('ls', ['-lh', '/usr']);
@@ -1526,8 +1533,10 @@ See also [`subprocess.kill()`][] and [`subprocess.send()`][].
15261533
added: v0.1.90
15271534
-->
15281535
1529-
* `code` {number} The exit code if the child process exited on its own.
1530-
* `signal` {string} The signal by which the child process was terminated.
1536+
* `code` {number} The exit code if the child process exited on its own, or
1537+
`null` if the child process terminated due to a signal.
1538+
* `signal` {string} The signal by which the child process was terminated, or
1539+
`null` if the child process did not terminated due to a signal.
15311540
15321541
The `'exit'` event is emitted after the child process ends. If the process
15331542
exited, `code` is the final exit code of the process, otherwise `null`. If the

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.