{"name":"when-exit","description":"Execute a function right before the process is about to exit.","version":"1.0.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rimraf dist","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"node test/index.js","prepublishOnly":"npm run clean && npm run compile"},"bugs":{"url":"https://github.com/fabiospampinato/when-exit/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/when-exit.git"},"keywords":["exit","catch","event","handle","hook","intercept","signal"],"devDependencies":{"@types/node":"^17.0.16","rimraf":"^3.0.2","typescript":"^4.5.5","typescript-transform-export-interop":"^1.0.4"},"gitHead":"8bb773c0c50088e2e63ee9e6354f29857b334e22","homepage":"https://github.com/fabiospampinato/when-exit#readme","_id":"when-exit@1.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-iptOY2Mp2YzxMEQ7RzdQFyz0Zgvx8PL8cOfdKPfSi+HhbviU6fWgZRWjHHY4Episgt0Pl45JlxDjGpxFRNjQRg==","shasum":"664845bdd3591b9b657ce40d830e61599aa5c304","tarball":"http://registry-npm.ywwl.com/when-exit/download/when-exit-1.0.0.tgz","fileCount":21,"unpackedSize":9466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAt1QCRA9TVsSAnZWagAApMEP/2EzKiuYKM5wJZYG6Xe5\numO2wOpVCHpOtUIijj4Xn0vp7cZxwhENWxMmZUqpHaJyVfBiaSz4lGPVLFCf\nKb8dH0EGgN6y8m7kl2iZ3I5iXSfv1pLsPas0g/LfdxRudTHtIfGFoTXRADFd\nj1b3U0/eXsk182h3bqHLl+2Tdv3RyzxwTlhLsyvql7Ys6HmRYTDLN/lMzCT8\nL3AxIvyGReU1x6NOFDVYpc+dhlmHRDRmxXgVJEe/V3AfvhzqqYqnyUO2Jwqn\nlZfu569UW8K8C8LEATPgdhzs6dRMVLT59pVEUhMJV64Q7t9McplKSlVdY4Tu\nii1PTxw26/o3WkM96jkmLiZ4e6qZhghtPV5Xd8eJ8GSX/BNN96qc8YGuEHRd\ncn/3f88Z6wi4Y2aKHKABVeUXqrr1uCLs8s3g6/UYev3IGXB6VP7l+MBZ8uwz\nV+mhUF0OjxiQ4wYdRAbJvVU+KF2zPxk6k2RFBklrxYBNNZMysIin9y7zycYQ\ncGzooP+VOGgs6xzqYy6vu1nMtWWEVXla2Y0GhABE3vsjJwSX8lZaVe/Tgu4X\n+c1LFRZ4fnyuGmyoJoeKIMgni+IYdJAwMOorhALDUlXGdAm0Ivk8xApe0ZeD\njXeLC3sAIOVaP2Xi8goT3zc00nyph0mH2mXDaBC7fLHMP6uw4Ut9/P458ar8\n/BCz\r\n=r3DI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOtIcTm8mD/jXZ603iVJKGZeUH5+IWmfFvPeTg93NxvwIgWgVlxvOP/A90ENUAClJQIJOu0Q0XfVxQN9B0ZEz2qdw="}],"size":3843,"noattachment":false,"key":"/when-exit/-/when-exit-1.0.0.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_1.0.0_1644354896074_0.9620101716198008"},"_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":1644354896204,"_cnpm_publish_time":1644354896204,"dist-tags":{"latest":"2.1.5"}}