{ "_id": "exit-hook", "_rev": "14-11162170983fcb249dadcdb59af9f468", "name": "exit-hook", "description": "Run some code when the process exits", "dist-tags": { "latest": "2.2.0" }, "versions": { "1.0.0": { "name": "exit-hook", "version": "1.0.0", "description": "Run some code when the process exits", "license": "MIT", "repository": { "type": "git", "url": "git://github.com/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" }, "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "homepage": "https://github.com/sindresorhus/exit-hook", "_id": "exit-hook@1.0.0", "_shasum": "84e17510af2f170df709c84bb70ba315b00c9019", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "dist": { "shasum": "84e17510af2f170df709c84bb70ba315b00c9019", "tarball": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.0.0.tgz" }, "directories": {} }, "1.1.0": { "name": "exit-hook", "version": "1.1.0", "description": "Run some code when the process exits", "license": "MIT", "repository": { "type": "git", "url": "git://github.com/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" }, "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "homepage": "https://github.com/sindresorhus/exit-hook", "_id": "exit-hook@1.1.0", "_shasum": "06f5ef551030ed7c0e3bc5148ee64c9f5626df87", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "dist": { "shasum": "06f5ef551030ed7c0e3bc5148ee64c9f5626df87", "tarball": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.0.tgz" }, "directories": {} }, "1.1.1": { "name": "exit-hook", "version": "1.1.1", "description": "Run some code when the process exits", "license": "MIT", "repository": { "type": "git", "url": "git://github.com/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" }, "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "homepage": "https://github.com/sindresorhus/exit-hook", "_id": "exit-hook@1.1.1", "_shasum": "f05ca233b48c05d54fff07765df8507e95c02ff8", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "dist": { "shasum": "f05ca233b48c05d54fff07765df8507e95c02ff8", "tarball": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz" }, "directories": {} }, "2.0.0": { "name": "exit-hook", "version": "2.0.0", "description": "Run some code when the process exits", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/exit-hook.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "exit", "quit", "process", "hook", "graceful", "handler", "shutdown", "sigterm", "sigint", "terminate", "kill", "stop", "event", "signal" ], "devDependencies": { "ava": "*", "execa": "^0.10.0", "xo": "*" }, "gitHead": "352e462d37878371ce7a54381b37a6be2369dfed", "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "homepage": "https://github.com/sindresorhus/exit-hook#readme", "_id": "exit-hook@2.0.0", "_npmVersion": "5.6.0", "_nodeVersion": "8.10.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-usCR1VCwZTqwnGjf2tZ4RlkM+E8W7sss2DXjXEBLpd5A9gOY9z/iJhVr2mFkk0o816tZqpuXCkcSTVzAdVXAXw==", "shasum": "b89f6f69b7d080efc2807c66a85957722637db92", "tarball": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.0.0.tgz", "fileCount": 4, "unpackedSize": 3438 }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/exit-hook_2.0.0_1521907482159_0.595395127353517" }, "_hasShrinkwrap": false }, "2.1.0": { "name": "exit-hook", "version": "2.1.0", "description": "Run some code when the process exits", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/exit-hook.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava" }, "keywords": [ "exit", "quit", "process", "hook", "graceful", "handler", "shutdown", "sigterm", "sigint", "terminate", "kill", "stop", "event", "signal" ], "devDependencies": { "ava": "*", "execa": "^0.10.0", "xo": "*" }, "gitHead": "79c3bcecff582833d77cf5a81696a8299abb3ab5", "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "homepage": "https://github.com/sindresorhus/exit-hook#readme", "_id": "exit-hook@2.1.0", "_nodeVersion": "8.15.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-JCSm9Znc/KW6hoKYHOIqLxM2Z88+AQcabo07rJHZSyXcQIq6HsXkSWRVZRp13RFkGVIDcz1DRIbKR5cnU1uzCA==", "shasum": "2be08d8d01220050878577bfa017e104a6c3bcf3", "tarball": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.1.0.tgz", "fileCount": 4, "unpackedSize": 3620, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrFfUCRA9TVsSAnZWagAAaXcP/1SFjXxTPZWQOTHViWVv\nUQYebm5HxckvDIDBnEbWGs66wZaIMNfWK4VF+Im0LlBsu/nZuWuhXunMU4rv\n33b6YowxRQItduXbTvIP9r+80F+qBqGQQpQn6r3hdwNtM4WVKI5tbXGpkujz\ntQVdFCqE0CPOsn2QQAoH8Mpbkk7BfaltDIKdgrcYk9SWb3+y8wECXqpcAxVJ\noy68VxbJq3PEZtHhg21kHoDxGygapaiUULY+lZIUC70rXkNFQS5yRdbJLJ9p\ny55FzTYT8HqBuh1gtMAH4vjF7nz0rCMaJyGBbo2mfKGvBLyfu0FuZ+K1Uqb5\nU83EEP+rc6zGCG8yMVRQDx4YbP5c5mDvuWS4WhHy+nnBQtFAtGDLls3mP+rj\nt/0IEtS4NteyClCeX4eI7P9JuyOiVZVIv169elX3OsjhHlPeDmPoVwwkkDk8\nYBKizeXtjnIVuZFkoyikviq9lRoj9xv3hvNYSYVydRol4B1s6I8oQxSRu+yq\nEF+KqKyj+D2PyKyJg6ZAnPV15U6PUjM0j13kOjMCkSMjeug4RbXJFiN5IJcZ\nc0veDHiFj7NQml0oSHZRo4lioqaqE3cctmln4RZlxJ4Dy4ZYK3zalB923W/1\no9oaDIiGPaAm8VyzlKMCOVdbFT2FVFhihKeossF6sJO+uAnbrkxKxy4vvQy4\nOT1F\r\n=4atc\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/exit-hook_2.1.0_1554798547565_0.05841812565502913" }, "_hasShrinkwrap": false }, "2.2.0": { "name": "exit-hook", "version": "2.2.0", "description": "Run some code when the process exits", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/exit-hook.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "exit", "quit", "process", "hook", "graceful", "handler", "shutdown", "sigterm", "sigint", "terminate", "kill", "stop", "event", "signal" ], "devDependencies": { "ava": "^1.4.1", "execa": "^1.0.0", "tsd": "^0.7.2", "xo": "^0.24.0" }, "gitHead": "f07fd96864d7c8c013ae8fb361ecb82d77a122f5", "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "homepage": "https://github.com/sindresorhus/exit-hook#readme", "_id": "exit-hook@2.2.0", "_nodeVersion": "8.15.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-YFH+2oGdldRH5GqGpnaiKbBxWHMmuXHmKTMtUC58kWSOrnTf95rKITVSFTTtas14DWvWpih429+ffAvFetPwNA==", "shasum": "f5502f92179018e867f2d8ee4428392da7f3894e", "tarball": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.0.tgz", "fileCount": 5, "unpackedSize": 4570, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctg6+CRA9TVsSAnZWagAAWJwP/26izlOlBKGmPmKccKp4\nJB17pRKgczcWGDEPqF9sCCRvhlaR5PgnsXy2rQynY/i8sVTFeHpeb0J2bqaI\nSsZtR5/QJ/ZDQFkLdggJGXhtbXe1Awx/aHgIe4RlPNXShmn489gm8fv2agGp\nq0P8AUdRmM7QIrjI/yW3HuNZMhmrjnecvffb3vW09ylgLOu3hBpUdikGFisr\n7Vo7hPEry2rDYlRCKoYDIN5Eb8++VK4cORAXej66Yc5Ewbl5VWeTfjTYBmpb\nQWeHv4rXDNqqHBXBUNuBzUJ7YuYRyUIoa866AcGvcNO4oC+ULZzgte8q4tnI\nRMKPkTwiwgNsOO+qnLIeUpbt4lo1XNaQSl8Gnj0rRGB7eO93eBlp6h+z2Oet\nB2i9pcNjrcLnq9UFc9VGRhP25oN/gnvRyMOn5plOCnm7HM0EuFbCTHf6n3Me\nupyQfIpJu0bZTzjGuS9eyeHBQtW3kKGLmofhiSQEPbqUUtr30mVg8DW7u0a/\nNG2+A6GoEWM0kLZE8T1H7/IS2E4ul3AgI0nSdURAeCUwMatu3wsaZjyXUtjE\n0Ntz8f7tf1vp1b1RQV4yRclUSDN8LU64AWQG9O9ZOPC3DDaIpx+a0Mz1KlP1\nTzGc5UgcHgUIslld/lXbmjxX50V8NyEHbWTgE8PaUVjFWaLPMtfzdOtF6eVQ\nthGm\r\n=e3Mc\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/exit-hook_2.2.0_1555435197535_0.6053662791757497" }, "_hasShrinkwrap": false } }, "readme": "# exit-hook [![Build Status](https://travis-ci.org/sindresorhus/exit-hook.svg?branch=master)](https://travis-ci.org/sindresorhus/exit-hook)\n\n> Run some code when the process exits\n\nThe `process.on('exit')` event doesn't catch all the ways a process can exit.\n\nThis package is useful for cleaning up before exiting.\n\nCheck out [`async-exit-hook`](https://github.com/tapppi/async-exit-hook) if you need async support.\n\n\n## Install\n\n```\n$ npm install exit-hook\n```\n\n\n## Usage\n\n```js\nconst exitHook = require('exit-hook');\n\nexitHook(() => {\n\tconsole.log('Exiting');\n});\n\n// You can add multiple hooks, even across files\nexitHook(() => {\n\tconsole.log('Exiting 2');\n});\n\nthrow new Error('🦄');\n\n//=> 'Exiting'\n//=> 'Exiting 2'\n```\n\nRemoving an exit hook:\n\n```js\nconst exitHook = require('exit-hook');\n\nconst unsubscribe = exitHook(() => {});\n\nunsubscribe();\n```\n\n\n## API\n\n### exitHook(callback)\n\nReturns a function that removes the hook when called.\n\n#### callback\n\nType: `Function`\n\nThe callback to execute when the process exits.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "time": { "modified": "2019-04-16T17:20:01.724Z", "created": "2014-08-31T11:19:13.581Z", "1.0.0": "2014-08-31T11:19:13.581Z", "1.1.0": "2014-08-31T23:31:07.279Z", "1.1.1": "2014-09-01T13:14:50.788Z", "2.0.0": "2018-03-24T16:04:42.431Z", "2.1.0": "2019-04-09T08:29:07.717Z", "2.2.0": "2019-04-16T17:19:57.671Z" }, "homepage": "https://github.com/sindresorhus/exit-hook#readme", "keywords": [ "exit", "quit", "process", "hook", "graceful", "handler", "shutdown", "sigterm", "sigint", "terminate", "kill", "stop", "event", "signal" ], "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/exit-hook.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/exit-hook/issues" }, "license": "MIT", "readmeFilename": "readme.md", "users": { "dylanf": true, "j3kz": true, "heartnett": true } }