From 5d2af02a1ffd653dacc0811f2971bf60544f7129 Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Mon, 26 Jun 2023 01:03:28 +0300 Subject: [PATCH] child_process: support `Symbol.dispose` --- 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`