slow-kill
Tries to kill a process nicely and after a timeout invokes kill(9).
Last updated 2 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install slow-kill 
SYNC missed versions from official npm registry.

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-kill

API

slowKill

Tries to kill a process nicely (via SIGTERM) and forcefully kills it if it didn't exit after a given timeout.

Parameters

  • proc Object the node process to kill
  • wait Number? time to wait before invoking kill(9) if process doesn't exit (optional, default 500)

Returns Promise a promise that resolves once the process exited

License

MIT

Current Tags

  • 0.1.0                                ...           latest (2 years ago)

1 Versions

  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |