https://github.com/caseywebdev/kill-it-with-fire
KILL IT WITH FIRE!
https://github.com/caseywebdev/kill-it-with-fire
Last synced: over 1 year ago
JSON representation
KILL IT WITH FIRE!
- Host: GitHub
- URL: https://github.com/caseywebdev/kill-it-with-fire
- Owner: caseywebdev
- Created: 2015-08-26T15:43:48.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-11-04T16:26:35.000Z (over 9 years ago)
- Last Synced: 2025-03-03T08:46:55.745Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

## Install
```
npm install kill-it-with-fire
```
## Usage
```js
var killItWithFire = require('kill-it-with-fire');
process.on('SIGTERM', function () {
// Do the stuff that *should* let your process exit cleanly...
sockets.closeEm();
server.stopIt();
connections.breakUpWith();
// And usually that works fine...but when something is still hanging...
killItWithFire();
// Alternatively, you can pass options to `killItWithFire()`.
killItWithFire({wait: 5000})
});
```
## `killItWithFire(options)`
#### `wait` (default `10000`)
The time (in ms) to wait before killing it with fire.
#### `log` (default `console.error.bind(console)`)
A function to use to log the immolation.
#### `code` (default `1`)
The code to exit the process with.