{"name":"when-exit","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/when-exit.git"},"description":"Execute a function right before the process, or the browser's tab, is about to exit.","version":"2.1.1","type":"module","main":"dist/node/index.js","types":"./dist/node/index.d.ts","exports":{"node":"./dist/node/index.js","default":"./dist/browser/index.js"},"scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"node test/index.js","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["exit","catch","event","handle","hook","intercept","signal"],"devDependencies":{"@types/node":"^18.13.0","tsex":"^3.0.0","typescript":"^5.1.6"},"gitHead":"e798252aaea6e0835cdff35137d00df1e5d6972b","bugs":{"url":"https://github.com/fabiospampinato/when-exit/issues"},"homepage":"https://github.com/fabiospampinato/when-exit#readme","_id":"when-exit@2.1.1","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-XLipGldz/UcleuGaoQjbYuWwD+ICRnzIjlldtwTaTWr7aZz8yQW49rXk6MHQnh+KxOiWiJpM1vIyaxprOnlW4g==","shasum":"08df6c5dafaf3d233ad153990d8a24d941bbe801","tarball":"http://registry-npm.ywwl.com/when-exit/download/when-exit-2.1.1.tgz","fileCount":28,"unpackedSize":10949,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJsrReI7/+7rsImXjTcLla2NX/Yr4JmKvQmX64lOxQyAiEAvdz04K7g4ZXO7YkwazU8OHsSKkB/lz4jtMZ5uUk1kb8="}],"size":3787,"noattachment":false,"key":"/when-exit/-/when-exit-2.1.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/when-exit_2.1.1_1691084259825_0.6819902852711528"},"_hasShrinkwrap":false,"readme":"# WhenExit\n\nExecute a function right before the process, or the browser's tab, is about to exit.\n\n## Install\n\n```sh\nnpm install --save when-exit\n```\n\n## Usage\n\n```ts\nimport whenExit from 'when-exit';\n\nonExit ( () => {\n  console.log ( 'Callback 1' );\n});\n\nonExit ( () => {\n  console.log ( 'Callback 2' );\n});\n\nconst disposer = onExit ( () => {\n  console.log ( 'Callback 3' );\n});\n\ndisposer ();\n\nprocess.exit (); // Callback 1 and 2 are called before exiting\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1691084260023,"_cnpm_publish_time":1691084260023,"dist-tags":{"latest":"2.1.5"}}