capture-exit
Allow cooprative async exit handlers, we unfortunately must hijack process.exit.
It allows a handler to ensure exit, without that exit handler impeding other similar handlers
for example, see: sindresorhus/ora#27
Differences between process.on('exit')
and captureExit.onExit(...)
=> https://github.com/ember-cli/capture-exit/issues/12
Installation
yarn add capture-exit// ornpm install --save capture-exit
Usage
// as early in startup as possible; // when you want to schedule some work on exit: { return something; // you can return promises, which will pause exit until fulfilled} ; // add an exit handler; // allows one to remove an exit handle if it is not longer required