mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-16 23:33:38 -05:00
chore(package): re-init package with commitizen and standard-release
This commit is contained in:
30
node_modules/exit-hook/index.js
generated
vendored
Normal file
30
node_modules/exit-hook/index.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var cbs = [];
|
||||
var called = false;
|
||||
|
||||
function exit(exit, signal) {
|
||||
if (called) {
|
||||
return;
|
||||
}
|
||||
|
||||
called = true;
|
||||
|
||||
cbs.forEach(function (el) {
|
||||
el();
|
||||
});
|
||||
|
||||
if (exit === true) {
|
||||
process.exit(128 + signal);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function (cb) {
|
||||
cbs.push(cb);
|
||||
|
||||
if (cbs.length === 1) {
|
||||
process.once('exit', exit);
|
||||
process.once('SIGINT', exit.bind(null, true, 2));
|
||||
process.once('SIGTERM', exit.bind(null, true, 15));
|
||||
}
|
||||
};
|
||||
39
node_modules/exit-hook/package.json
generated
vendored
Normal file
39
node_modules/exit-hook/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "exit-hook",
|
||||
"version": "1.1.1",
|
||||
"description": "Run some code when the process exits",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/exit-hook",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"exit",
|
||||
"quit",
|
||||
"process",
|
||||
"hook",
|
||||
"graceful",
|
||||
"handler",
|
||||
"shutdown",
|
||||
"sigterm",
|
||||
"sigint",
|
||||
"terminate",
|
||||
"kill",
|
||||
"stop",
|
||||
"event"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4"
|
||||
}
|
||||
}
|
||||
40
node_modules/exit-hook/readme.md
generated
vendored
Normal file
40
node_modules/exit-hook/readme.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# exit-hook [](https://travis-ci.org/sindresorhus/exit-hook)
|
||||
|
||||
> Run some code when the process exits
|
||||
|
||||
The `process.on('exit')` event doesn't catch all the ways a process can exit.
|
||||
|
||||
Useful for cleaning up.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save exit-hook
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var exitHook = require('exit-hook');
|
||||
|
||||
exitHook(function () {
|
||||
console.log('exiting');
|
||||
});
|
||||
|
||||
// you can add multiple hooks, even across files
|
||||
exitHook(function () {
|
||||
console.log('exiting 2');
|
||||
});
|
||||
|
||||
throw new Error('unicorns');
|
||||
|
||||
//=> exiting
|
||||
//=> exiting 2
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user