{"name":"capture-exit","version":"1.2.0","description":"safely cleanup in signal handlers","main":"index.js","scripts":{"test":"mocha test","test:debug":"mocha debug test"},"files":["index.js"],"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":"^3.5.0","execa":"0.4.0","mocha":"^3.1.2","ora":"^0.3.0"},"dependencies":{"rsvp":"^3.3.3"},"gitHead":"063a5b87271caf34f0ba367ebbbb7354a24f14a1","_id":"capture-exit@1.2.0","_shasum":"1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"ember-cli","email":"stefan.penner+ember-cli@gmail.com"},"dist":{"shasum":"1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f","tarball":"http://registry-npm.ywwl.com/capture-exit/download/capture-exit-1.2.0.tgz","integrity":"sha512-IS4lTgp57lUcpXzyCaiUQcRZBxZAkzl+jNXrMUXZjdnr2yujpKUMG9OYeYL29i6fL66ihypvVJ/MeX0B+9pWOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPbzVsaE4Zm6J5TA75v/zwPOaqTggs6y3l/ugpEwg8/gIgFJ03wdmkJYtibEIGss2UpNzfHebUmEqqxoUMIbtYDkg="}],"size":2136,"noattachment":false,"key":"/capture-exit/-/capture-exit-1.2.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"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/capture-exit-1.2.0.tgz_1484606943980_0.9743934394791722"},"directories":{},"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":1484606945765,"_cnpm_publish_time":1484606945765,"dist-tags":{"latest":"2.0.0"}}