From 3b3838d8021ce3501e972e55ad21edb5f817858b Mon Sep 17 00:00:00 2001 From: Matthew Francis Brunetti Date: Sat, 20 Mar 2021 05:14:04 -0400 Subject: [PATCH] doc: clarify when child process 'spawn' event is *not* emitted Making this clarification in response to a comment on GitHub: https://github.com/nodejs/node/issues/35288#issuecomment-802811813 PR-URL: https://github.com/nodejs/node/pull/37833 Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- doc/api/child_process.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 77467cc6573064..aace7566e49764 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1162,6 +1162,8 @@ added: v15.1.0 --> The `'spawn'` event is emitted once the child process has spawned successfully. +If the child process does not spawn successfully, the `'spawn'` event is not +emitted and the `'error'` event is emitted instead. If emitted, the `'spawn'` event comes before all other events and before any data is received via `stdout` or `stderr`.