Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

capture-exit

Package Overview
Dependencies
1
Maintainers
4
Versions
11
Issues
File Explorer

Advanced tools

capture-exit

safely cleanup in signal handlers

    2.0.0latest

Version published
Maintainers
4
Weekly downloads
8,119,716
decreased by-11.98%

Weekly downloads

Readme

Source

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

FAQs

What is capture-exit?

safely cleanup in signal handlers

Is capture-exit popular?

The npm package capture-exit receives a total of 7,791,470 weekly downloads. As such, capture-exit popularity was classified as popular.

Is capture-exit well maintained?

We found that capture-exit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 4 open source maintainers collaborating on the project.

Last updated on 21 Dec 2018

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc