{"name":"capture-exit","version":"2.0.0","description":"safely cleanup in signal handlers","main":"index.js","scripts":{"test":"mocha test","test:debug":"mocha debug test"},"repository":{"type":"git","url":"git+https://github.com/stefanpenner/capture-exit.git"},"author":{"name":"Stefan Penner","email":"stefan.penner@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/stefanpenner/capture-exit/issues"},"homepage":"https://github.com/stefanpenner/capture-exit#readme","devDependencies":{"chai":"^4.2.0","execa":"1.0.0","mocha":"^5.2.0","ora":"^3.0.0"},"dependencies":{"rsvp":"^4.8.4"},"engines":{"node":"6.* || 8.* || >= 10.*"},"_id":"capture-exit@2.0.0","dist":{"shasum":"fb953bfaebeb781f62898239dabb426d08a509a4","integrity":"sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==","tarball":"http://registry-npm.ywwl.com/capture-exit/download/capture-exit-2.0.0.tgz","fileCount":4,"unpackedSize":6209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHRhGCRA9TVsSAnZWagAAcZ4P/2ftuJNMBmxGgQ5YJJTW\nnwV4FN+C7HeITMHfyWV6FvA4b1Phv1s1EzQMZ2mQp3+W6jzAcZ3OZqxVxDbA\nH5UcOS+kM43CTIBf+KnuOjrcHiHiGYwIQ3fK5liEeYMiWrfseP4Im0zuCEIw\nyFMbQsfapM7EED8e8rsa6ekbQL4Y5iLeZ/ZdSozixh2QvsuBqqe6Rfqs2CBM\nE9qaq9IeEdUHa1yPOh8t+wyT2+j8rQgaElUivetaph3dxdms9nUTMx2NKl6s\nbzVEmVKjnTbT3Ci5mslmI5j5801WGDlqBab0NJTqJK0fOngVebd3YFgGe5Sa\nGOkVHDru3iWOBmmsLgh1KJ7yXqDdxcBFc1cmhB+JQEHfPTPIc5psT/duQzg7\nfoMBEytwynVjgxEkHfjw2CKmJhob0UCPhC5SCfu2j9BZwbxVFLPnyQ5ggtyi\nMIBrrhpRCjM1Z8Z3a88ApljVDIec3IMwu3RdiLUmSjui5dU1EC54l0AW1iW5\nDDTKW+ul9AbUkYx1+olsCFwoMvX0IBp6hmrqOCyPhf7Pt/HVFvpce6ugnx85\nG1XiShqPxAxprQ+4RWIL+2KZfJzzrlqCsy3eNF3EjzzPG9p6u31ABMbbPLJg\nvNhW7KHm8Cdq/bohyshMcBTzKa+/PggGdJZH5+7fj4eBfjOFaq8WzMg+DZNn\ncUXl\r\n=ulbQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfOCMG5Lbv0KgCmskAVI3GqpUvhIEpat8JFgMNSsZpYgIgBQWH9dixM8z3i+55Hgr3vyQIXnUlL13TGpXsUNw37Cw="}],"size":2412,"noattachment":false,"key":"/capture-exit/-/capture-exit-2.0.0.tgz"},"maintainers":[{"name":"ember-cli","email":"stefan.penner+ember-cli@gmail.com"},{"name":"hjdivad","email":"npm@hjdivad.com"},{"name":"rwjblue","email":"me@rwjblue.com"},{"name":"stefanpenner","email":"stefan.penner@gmail.com"}],"_npmUser":{"name":"rwjblue","email":"me@rwjblue.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/capture-exit_2.0.0_1545410630121_0.7341934041369735"},"_hasShrinkwrap":false,"readme":"# capture-exit\n\n[![Build status](https://ci.appveyor.com/api/projects/status/8044m918rwic8b9n/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/capture-exit/branch/master)\n[![Build Status](https://travis-ci.org/ember-cli/capture-exit.svg?branch=master)](https://travis-ci.org/ember-cli/capture-exit)\n\nAllow cooprative async exit handlers, we unfortunately must hijack\nprocess.exit.\n\nIt allows a handler to ensure exit, without that exit handler impeding other\nsimilar handlers\n\nfor example, see: [sindresorhus/ora#27](https://github.com/sindresorhus/ora/issues/27)\n\nDifferences between `process.on('exit')` and `captureExit.onExit(...)` => https://github.com/ember-cli/capture-exit/issues/12\n\n\n### Installation\n\n```sh\nyarn add capture-exit\n// or\nnpm install --save capture-exit\n```\n\n### Usage\n\n```js\n// as early in startup as possible\nrequire('capture-exit').captureExit();\n\n// when you want to schedule some work on exit:\nfunction onExit() {\n  return something.processWillExit(); // you can return promises, which will pause exit until fulfilled\n}\n\nrequire('capture-exit').onExit(onExit); // add an exit handler\nrequire('capture-exit').offExit(onExit); // allows one to remove an exit handle if it is not longer required\n```\n","publish_time":1545410630251,"_cnpm_publish_time":1545410630251,"dist-tags":{"latest":"2.0.0"}}