capture-exit

WebJar for capture-exit

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

capture-exit
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

capture-exit
WebJar for capture-exit
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ember-cli/capture-exit

Download capture-exit

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/capture-exit/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>capture-exit</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/capture-exit/
implementation 'org.webjars.npm:capture-exit:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/capture-exit/
implementation ("org.webjars.npm:capture-exit:2.0.0")
'org.webjars.npm:capture-exit:jar:2.0.0'
<dependency org="org.webjars.npm" name="capture-exit" rev="2.0.0">
  <artifact name="capture-exit" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='capture-exit', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "capture-exit" % "2.0.0"
[org.webjars.npm/capture-exit "2.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : rsvp jar [4.8.4,5)

Project Modules

There are no modules declared in this project.

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
org.webjars.npm

ember-cli

Versions

Version
2.0.0