{"_id":"on-exit","_rev":"4-d760bc4c9f91de0c3f1457ee3ec82107","name":"on-exit","description":"Register tasks to perform when the process exits.","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"on-exit","version":"1.0.0","description":"Register tasks to perform when the process exits.","main":"index.js","scripts":{"test":"mocha ./tests/index.js"},"keywords":["process","exit","on-exit","SIGINT","SIGTERM","cleanup","event","shutdown"],"author":{"name":"Matt Dunlap","email":"mpdunlap@gmail.com"},"repository":{"type":"git","url":"git@github.com:Prestaul/on-exit.git"},"license":"MIT","devDependencies":{"chai":"^2.3.0","mocha":"^2.2.4"},"bugs":{"url":"https://github.com/Prestaul/on-exit/issues"},"homepage":"https://github.com/Prestaul/on-exit","_id":"on-exit@1.0.0","_shasum":"c1ac0c02b369464f9bfc256fa3e4716e05660b40","_from":".","_npmVersion":"2.7.6","_nodeVersion":"0.10.35","_npmUser":{"name":"prestaul","email":"mpdunlap@gmail.com"},"dist":{"shasum":"c1ac0c02b369464f9bfc256fa3e4716e05660b40","tarball":"https://registry.npmjs.org/on-exit/-/on-exit-1.0.0.tgz","integrity":"sha512-lK5JLnhmGTW4kVavkl6dMoYIFPrWoiKVpTXmWcNbWZ1DEa2fHcWLcxEa2v5rbC5xf1oBiWlOhzeU7CLMfhUPRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFAHDhEej+JyYQHSAhHxnJDJMUvGIQke9/jWDLu/toNAiEA4GSVy1wzQIWCG2OE4MhBADrD0sbeI8T84cTaU7jsl/I="}]},"maintainers":[{"name":"prestaul","email":"mpdunlap@gmail.com"}]},"1.0.1":{"name":"on-exit","version":"1.0.1","description":"Register tasks to perform when the process exits.","main":"index.js","scripts":{"test":"mocha ./tests/index.js"},"keywords":["process","exit","on-exit","SIGINT","SIGTERM","cleanup","event","shutdown"],"author":{"name":"Matt Dunlap","email":"mpdunlap@gmail.com"},"repository":{"type":"git","url":"git@github.com:Prestaul/on-exit.git"},"license":"MIT","devDependencies":{"chai":"^2.3.0","mocha":"^2.2.4"},"gitHead":"4330db595094fc6d85738b6e5615bfe11bd42c03","bugs":{"url":"https://github.com/Prestaul/on-exit/issues"},"homepage":"https://github.com/Prestaul/on-exit","_id":"on-exit@1.0.1","_shasum":"52e19c1521ff21a42a56cc3476b8b44146b88b3f","_from":".","_npmVersion":"2.7.6","_nodeVersion":"0.10.35","_npmUser":{"name":"prestaul","email":"mpdunlap@gmail.com"},"dist":{"shasum":"52e19c1521ff21a42a56cc3476b8b44146b88b3f","tarball":"https://registry.npmjs.org/on-exit/-/on-exit-1.0.1.tgz","integrity":"sha512-8J4mOZv71V3vVDRhUd6WuwnzUR7q3CsLoF1wOdcFazmcho4AyPKzQjV6eT0DJbZ4+GiSb4YSjZIZMJ8dtL/+qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBvGGXxV+trFJYNiizgWs6AHqbW+WWAKRd7euypFxi/gIhAKFjNqljpAZXyp3mvYd22MUzYAmAXAy9QcJchjPmT6f0"}]},"maintainers":[{"name":"prestaul","email":"mpdunlap@gmail.com"}]}},"readme":"# on-exit\n\nEasily register tasks to perform when the current node process exits.\n\n\n# Install\n\n```bash\nnpm install on-exit\n```\n\n\n## Usage\nCall onExit one or more times to add process cleanup tasks:\n\n```js\nvar onExit = require('on-exit');\n\nonExit(function() {\n\tconsole.log('Closing db connections...');\n\tdb.close();\n});\n\nonExit(function() {\n\tconsole.log('Performing other cleanup...');\n\tapp.cleanup();\n});\n```\n\nWhen the process exits handlers will be run in the order that they were added.\n\n\n## Debug logs\nYou can set a logging function if you would like to log kill signals and exit events:\n\n```js\nvar onExit = require('on-exit').logger(function(msg) {\n    myCustomLogger.log(msg);\n});\n\n// Or to console.log\nonExit.logger(console.log.bind(console));\n```\n","maintainers":[{"name":"prestaul","email":"mpdunlap@gmail.com"}],"time":{"modified":"2022-06-22T21:27:19.121Z","created":"2015-04-28T16:21:25.653Z","1.0.0":"2015-04-28T16:21:25.653Z","1.0.1":"2015-04-28T19:03:11.336Z"},"homepage":"https://github.com/Prestaul/on-exit","keywords":["process","exit","on-exit","SIGINT","SIGTERM","cleanup","event","shutdown"],"repository":{"type":"git","url":"git@github.com:Prestaul/on-exit.git"},"author":{"name":"Matt Dunlap","email":"mpdunlap@gmail.com"},"bugs":{"url":"https://github.com/Prestaul/on-exit/issues"},"license":"MIT","readmeFilename":"README.md"}