exit-hook

WebJar for exit-hook

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

exit-hook
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

exit-hook
WebJar for exit-hook
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/exit-hook

Скачать exit-hook

Как подключить последнюю версию

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

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

exit-hook Build Status

Run some code when the process exits

The process.on('exit') event doesn't catch all the ways a process can exit.

This package is useful for cleaning up before exiting.

Install

$ npm install exit-hook

Usage

const exitHook = require('exit-hook');

exitHook(() => {
	console.log('Exiting');
});

// You can add multiple hooks, even across files
exitHook(() => {
	console.log('Exiting 2');
});

throw new Error('🦄');

//=> 'Exiting'
//=> 'Exiting 2'

Removing an exit hook:

const exitHook = require('exit-hook');

const unsubscribe = exitHook(() => {});

unsubscribe();

API

exitHook(callback)

Returns a function that removes the hook when called.

callback

Type: Function

The callback to execute when the process exits.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Версии библиотеки

Версия
1.1.1