Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

kill-on-exit

matthewp907BSD-2-Clause1.2.0

Ensure child processes are closed when the parent closes

child_process, spawn

readme

kill-on-exit

Makes sure child processes are cleaned up (killed) when the parent process exits.

Install

npm install kill-on-exit --save

Use

var spawn = require("child_process").spawn;
var killOnExit = require("kill-on-exit");

var child = spawn("long-process");
killOnExit(child);

License

BSD 2 Clause