diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 2b6fabc3e1d293..6f6c81e253ff06 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1039,6 +1039,21 @@ child process, the `message` argument can contain data that JSON is not able to represent. See [Advanced serialization][] for more details. +### Event: `'spawn'` + + +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`