2.0.0 • Published 3 months ago
end-child-processes v2.0.0
End-Child-Processes
This library ends all child processes spawned by the current process, including nested child processes. The current process itself remains unaffected.
Installation
npm install --save end-child-processes
Usage
import { endChildProcesses } from "end-child-processes"
// spawn a long-running subprocess
import * as childProcess from "child_process"
childProcess.exec("node -e 'while (true) {}'")
// end all running subprocesses spawned by this program
await endChildProcesses()
Related work
Dependent on your use case, these other libraries that might also be a good fit for you:
- ps-tree: displays information about all running subprocesses
- tree-kill: ends all processes in the process tree, including the current process
- @jub3i/tree-kill: ends all processes in the process tree, including the current process