2.0.0 • Published 5 years ago

capture-exit v2.0.0

Weekly downloads
10,087,698
License
ISC
Repository
github
Last release
5 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-1294npm_qwertynumhandlernpm-package-mentorchecknove-repositorynpm_one_12_34_1_npm_one_1_2_3npm_one_2_2native-apple-loginnative-google-loginnative-kakao-loginmpesa-cookiempesa-cookie-jarpayutestingparvan_componentsparvan_reactjs_componentslayer-genlib-errormama-exportermd-vditormoonwalkerswap-default-token-listsraact-native-arunramya151polen-web-components-reactpyreswap-sdktestapasyncbackbasestailwind-vector-effecttest-library-123testnpm_lmnstringlbstp-cdksvelte-component-libsuperset-plugin-chart-hello-world2sushi-sdk-ftmsupercluster-googlemaps-adapter-clonestypeorm-polymorphic-cloneu-librarytwine-libtwine-libraryreact-native-badge-controlreact-native-biometric-authenticatereact-native-bubble-chartreact-native-brother-projectreact-native-firebase-messagingreact-native-flyyreact-native-dsphoto-modulereact-native-dm-playerreact-native-hlf-wrapperreact-native-arun-ramya-testreact-native-arunjeyam1987react-native-arunmeena1987react-native-arunramya151react-angular-componentreact-native-ytximkitreact-native-version-managerreact-native-vnpay-merchantreact-native-template-vifereact-native-touch-id-namgyureact-native-template-nascam-templatereact-native-test-module-hhhreact-native-transtracker-libraryreact-native-testwebreact-native-twilio-voice-sdk-upgradereact-plugin-package-corereact-picky-with-clearsequelcomponentspotify-ds-sesharingcomponent2sane-updates
2.0.0

5 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago