Skip to content

kevgo/end-child-processes

Repository files navigation

End-Child-Processes

tests windows Coverage Status install size

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()

How it works

On Windows, this library does not attempt to end the WMIC.exe process since it terminates on its own.

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

About

Reliably ends all direct and indirect child processes of the current process

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •