Skip to content

Commit bb8db84

Browse files
Linkgorontargos
authored andcommitted
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent be28376 commit bb8db84

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/api/child_process.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -991,9 +991,11 @@ added: v0.7.7
991991
* `code` {number} The exit code if the child exited on its own.
992992
* `signal` {string} The signal by which the child process was terminated.
993993

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

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

0 commit comments

Comments
 (0)