{"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.3","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"},"_id":"when-exit@2.1.3","gitHead":"bbe129f6fbb84190e79a9bd2fc246b40bfa17da6","bugs":{"url":"https://github.com/fabiospampinato/when-exit/issues"},"homepage":"https://github.com/fabiospampinato/when-exit#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-uVieSTccFIr/SFQdFWN/fFaQYmV37OKtuaGphMAzi4DmmUlrvRBJW5WSLkHyjNQY/ePJMz3LoiX9R3yy1Su6Hw==","shasum":"5831cdbed8ad4984645da98c4a00d4ee3a3757e7","tarball":"http://registry-npm.ywwl.com/when-exit/download/when-exit-2.1.3.tgz","fileCount":28,"unpackedSize":11845,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCH81QYM/0QTCK0MCs83L8bK0AAU4cebYUjniX7IGKDHAIgeuHqbeZZbvcfZguh8u+Hx3kQHJ9ROyMVN7WYRscR45Q="}],"size":4001,"noattachment":false,"key":"/when-exit/-/when-exit-2.1.3.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/when-exit_2.1.3_1719755355632_0.04754522859264143"},"_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":1719755355795,"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1719755355795,"dist-tags":{"latest":"2.1.5"}}