From 4e08160f8c72ee2a59aae9c13a95092a97be1f5f Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Wed, 5 Jul 2023 13:21:14 +0300 Subject: [PATCH] child_process: support `Symbol.dispose` PR-URL: https://github.com/nodejs/node/pull/48551 Reviewed-By: Robert Nagy Reviewed-By: Benjamin Gruenbaum --- doc/api/child_process.md | 10 +++++++++ lib/internal/child_process.js | 7 ++++++ test/parallel/test-child-process-destroy.js | 25 +++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 test/parallel/test-child-process-destroy.js diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 70345e9472c66e..2c644c61c5f1ad 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1402,6 +1402,16 @@ setTimeout(() => { }, 2000); ``` +### `subprocess[Symbol.dispose]()` + + + +> Stability: 1 - Experimental + +Calls [`subprocess.kill()`][] with `'SIGTERM'`. + ### `subprocess.killed`