Function: kill()
kill(
child,options?):Promise<void>
Stop a child process and descendants discovered through operating-system process snapshots.
The initial tree is retained before signaling so descendants remain
targetable after their parent exits or they are reparented. Polling refreshes
the process table, merges newly created descendants, and sends each one the
active shutdown signal once. Either phase can be disabled for graceful-only
or force-only termination. macOS and other POSIX platforms use ps; Windows
uses the built-in PowerShell CIM process provider.
Windows does not implement POSIX signal semantics. Node terminates processes
unconditionally for supported signals there, including SIGTERM.
Parameters
Section titled “Parameters”ChildProcess
Root child process whose snapshotted tree should stop
options?
Section titled “options?”KillOptions = {}
Graceful signal, force signal, timeout, and polling policy
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”When the process table cannot be captured, a signal cannot be sent, or identity-matched processes remain after the final enabled phase