0.1.0 • Published 7 years ago
slow-kill v0.1.0
slow-kill
Tries to kill a process nicely and after a timeout invokes kill(9).
const { spawn } = require('child_process')
const TIMEOUT = 500
const proc = spawn(process.execPath, [ require.resolve('some-script') ])
await slowKill(proc, TIMEOUT)Installation
npm install slow-killAPI
slowKill
Tries to kill a process nicely (via SIGTERM) and forcefully kills it if it didn't exit after a given timeout.
Parameters
procObject the node process to killwaitNumber? time to wait before invokingkill(9)if process doesn't exit (optional, default500)
Returns Promise a promise that resolves once the process exited
License
MIT
0.1.0
7 years ago