Files
node/doc/api
Dan Fabulich 3dd26f32fb doc: recommend events.once to manage 'close' event
`events.once` is a great way to manage the `close` / `error` / `exit`
events of a child process. It creates a Promise that is fulfilled when
the EventEmitter emits the given event or that is rejected if the
EventEmitter emits 'error' while waiting.

I think a lot of people wrongly think that managing a spawned child
process requires writing boilerplate handlers for `close` and `error`,
and that there's no `promisify` solution for spawned child processes. In
fact, `events.once` is that solution. The docs should explicitly
recommend it in examples.

PR-URL: https://github.com/nodejs/node/pull/60017
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-11-08 15:04:44 +00:00
..
2025-10-28 20:03:00 +01:00
2025-10-16 08:17:53 +00:00
2025-11-08 09:36:45 +00:00
2025-07-15 17:18:42 +00:00
2025-06-09 23:45:29 +02:00
2025-07-15 17:18:42 +00:00
2024-11-01 03:43:53 +00:00
2025-07-28 20:03:37 +00:00
2025-10-15 13:27:47 -03:00
2025-11-08 14:34:49 +00:00
2025-07-15 17:18:42 +00:00
2025-07-15 17:18:42 +00:00
2025-08-29 02:24:57 +00:00
2025-07-15 17:18:42 +00:00
2025-07-15 17:18:42 +00:00
2025-11-02 19:09:37 +00:00
2025-11-08 09:36:45 +00:00
2025-06-09 23:45:29 +02:00
2025-07-15 17:18:42 +00:00
2025-07-15 17:18:42 +00:00
2025-11-05 02:52:26 +00:00
2025-10-21 01:45:50 +02:00
2025-07-15 17:18:42 +00:00