UNPKG

kill-sync

Version:

Cross-platform kill command. Supports recusive/tree-kill in a synchronous manner.

19 lines 567 B
import { execSync } from 'child_process'; import { killPid, treeKill } from './treekill'; const killSync = (pid, signal, recursive = false) => { signal = signal !== null && signal !== void 0 ? signal : 'SIGTERM'; if (!recursive) { return killPid(pid, signal); } switch (process.platform) { case 'win32': execSync(`taskkill /pid ${pid} /T /F`); break; case 'darwin': default: treeKill(pid, signal); break; } }; export default killSync; //# sourceMappingURL=kill.js.map