2.0.0 • Published 7 years ago

capture-exit v2.0.0

Weekly downloads
10,087,698
License
ISC
Repository
github
Last release
7 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_modreact-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-deploysuperset-plugin-chart-hello-world2supercluster-googlemaps-adapter-clonesspotify-ds-sestp-cdktestapatestnpm_lmnsvelte-component-libvision-camera-plugin-scan-faces@blkmarketco/components-library@rps-engine/core@percent/percent-api-hooks@poscredit/plugin-chart-boris@routebuddies/react-native-mapbox-navigationjnf-accesscontrol-rnttllayer-geniex-sdkhot-zone-vuehexyun.helpersgrids-over-polygongzup-react-image-file-resizerlib-errormama-exporterkrown_login_librarymd-vditor@wecraftapps/react-native-use-keyboard@thinkincoin-libs/token-lists@udooku/react-image-comparison-slider@torgeircook/cssjson@tonysusi/vapid@torswap/tor-token-lists@traitsniper/web3-react-connector@traitsniper/web3-react-v6-connector@vidit-me/react-native-wheely@upacyxou/react-native-draggable-flatlist@vitali_shcherbina/styled-lib@xswap/token-lists@yplabs-ltd/react-native-detector@zalastax/nolb-capt@zh0st/evm-chainsaffinidi-auth-sdk-kernelact_mvvm_shop_cartadyen-rnaxonv2sdkb2x-utilsastra-ufo-sdkbabel-plugin-specify-importsant-design-draggable-modal-4ant-design-draggable-modal-fixant-design-draggable-modal-fix-2appcharge-checkoutasync-busbackend-testing-core@happy-gastro/react-native-printer-module@gzup/react-image-file-resizer@achii/ts-results@affinidi/affinidi-auth-sdk-kernel@adpt/utils@edecamps/react-native-animated-code-input@coboxcoop/seeder@alexshmyrkov/react-ranger@corelmax/react-native-my2c2p-sdk@hazyflame/vue-jitsi-meet@hawkingnetwork/react-native-tab-view@hbglobal/react-native-actions-shortcuts
2.0.0

7 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago