X Tutup
The Wayback Machine - https://web.archive.org/web/20230218234016/https://github.com/nodejs/node/commit/bb8db846b3
Skip to content
Permalink
Browse files
doc: clarify child_process close event
clarify the 'close' event description in the child_process docs.

fixes: #37998

PR-URL: #38181
Fixes: #37998
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Linkgoron authored and targos committed May 1, 2021
1 parent be28376 commit bb8db84
Showing 1 changed file with 5 additions and 3 deletions.
@@ -991,9 +991,11 @@ added: v0.7.7
* `code` {number} The exit code if the child exited on its own.
* `signal` {string} The signal by which the child process was terminated.

The `'close'` event is emitted when the stdio streams of a child process have
been closed. This is distinct from the [`'exit'`][] event, since multiple
processes might share the same stdio streams.
The `'close'` event is emitted after a process has ended _and_ the stdio
streams of a child process have been closed. This is distinct from the
[`'exit'`][] event, since multiple processes might share the same stdio
streams. The `'close'` event will always emit after [`'exit'`][] was
already emitted, or [`'error'`][] if the child failed to spawn.

```js
const { spawn } = require('child_process');

0 comments on commit bb8db84

Please sign in to comment.
X Tutup