2.0.0 • Published 6 years ago

capture-exit v2.0.0

Weekly downloads
10,087,698
License
ISC
Repository
github
Last release
6 years ago

capture-exit

Build status Build Status

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
// or
npm install --save capture-exit

Usage

// as early in startup as possible
require('capture-exit').captureExit();

// when you want to schedule some work on exit:
function onExit() {
  return something.processWillExit(); // you can return promises, which will pause exit until fulfilled
}

require('capture-exit').onExit(onExit); // add an exit handler
require('capture-exit').offExit(onExit); // allows one to remove an exit handle if it is not longer required
sanearchetype-libraryreact-native-bluetooth2killi8n-react-native-fast-imagern-send-smsspecify-importsbabel-specify-imports@icanpm/api-masterreact-native-template-rfbaseairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesregeniereact-native-covid-sdkgql_din_modbitgetreact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-libraryreact-native-printer-brothersrn-pdf-reader-offlinewilscanner@mink-opn/build-tokensreact-native-slider-kf@infinitebrahmanuniverse/nolb-capt@saaspe/componentsplginexpand-react-bridge@everything-registry/sub-chunk-1294tailwind-vector-effectsyncbackbasestest-library-123webchewoven-challenge-deployrn-tm-notifyrn-use-modal-hookrn-session-multiplier-demornttlocksharingcomponent2sane-updatesresponsive-react-appreikamoon-string-library-aarn-adyen-dropinsuperset-plugin-chart-hello-world2supercluster-googlemaps-adapter-clonesspotify-ds-sestp-cdksequelcomponenttestapatestnpm_lmnsvelte-component-libvision-camera-plugin-scan-facesdfeuk-frontenddfeuk-frontend-manualsushi-sdk-ftmlib-errorlayer-gengrids-over-polygonmpesa-cookiempesa-cookie-jarmoonwalkerswap-default-token-listskrown_login_libraryhexyun.helpershot-zone-vueiex-sdkgoogle-remakegzup-react-image-file-resizermama-exportermd-vditornove-repositoryparvan_componentsparvan_reactjs_componentsplugin-chart-ftthplugin-hellopolen-web-components-reactnpm_one_12_34_1_npm_one_1_2_3npm_one_2_2npm_qwertypayutestingreact-angular-componentraact-native-arunramya151react-form-component-libraryreact-native-create-video-thumbnailreact-native-cplusreact-native-flyyreact-native-dm-playerreact-native-contact-listreact-native-dsphoto-modulereact-native-firebase-messagingreact-native-bubble-chartreact-native-brother-projectreact-native-vnpay-merchantreact-native-ytximkitreact-rect-progressbarreact-native-version-managerreact-router-v5-v6-bridged-features
2.0.0

6 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago