diff options
author | Matthew Francis Brunetti <zenflow87@gmail.com> | 2020-09-27 22:00:07 +0300 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2020-10-28 10:02:50 +0300 |
commit | 3df5afb367cf6ae4b6309ad54e1a9cb2e6884d27 (patch) | |
tree | 0a7f774b50476150044687800954bad4c903f83f /doc/api/child_process.md | |
parent | 923f76d5231256e69985e1bd897fd490ea0cbe9c (diff) |
child_process: add ChildProcess 'spawn' event
The new event signals that the subprocess has spawned successfully and
no 'error' event will be emitted from failing to spawn.
Fixes: https://github.com/nodejs/node/issues/35288
PR-URL: https://github.com/nodejs/node/pull/35369
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'doc/api/child_process.md')
-rw-r--r-- | doc/api/child_process.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/api/child_process.md b/doc/api/child_process.md index bfe7850ad0d..0f78ba9d44e 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1036,6 +1036,21 @@ child process, the `message` argument can contain data that JSON is not able to represent. See [Advanced serialization][] for more details. +### Event: `'spawn'` +<!-- YAML +added: REPLACEME +--> + +The `'spawn'` event is emitted once the child process has spawned successfully. + +If emitted, the `'spawn'` event comes before all other events and before any +data is received via `stdout` or `stderr`. + +The `'spawn'` event will fire regardless of whether an error occurs **within** +the spawned process. For example, if `bash some-command` spawns successfully, +the `'spawn'` event will fire, though `bash` may fail to spawn `some-command`. +This caveat also applies when using `{ shell: true }`. + ### `subprocess.channel` <!-- YAML added: v7.1.0 |