{"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.2","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.2","gitHead":"00fc9cec8b8f61a652b944bcb707d59851a7085b","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-u9J+toaf3CCxCAzM/484qNAxQE75rFdVgiFEEV8Xps2gzYhf0tx73s1WXDQhkwV17E3MxRMz40m7Ekd2/121Lg==","shasum":"888d8af6770e2b772fa3677aba1aff1a54320511","tarball":"http://registry-npm.ywwl.com/when-exit/download/when-exit-2.1.2.tgz","fileCount":28,"unpackedSize":11607,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCC/NhzVNBCOTSVv9KkSKsaRKZRS0BTBfkua4v0iw1TZwIfPyswL7z1XRDG23x5zsaV30HnxiLBu2NZ9IfW1cB/hw=="}],"size":3950,"noattachment":false,"key":"/when-exit/-/when-exit-2.1.2.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.2_1702165848973_0.28250636189738976"},"_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":1702165849205,"_cnpm_publish_time":1702165849205,"dist-tags":{"latest":"2.1.5"}}