@biorate/shutdown-hook
TypeScript icon, indicating that this package has built-in type declarations

1.42.1 • Public • Published

Shutdown hook

Shutdown hook implementation for Node.JS

Example:

import { ShutdownHook } from '@biorate/shutdown-hook';
import { timer } from '@biorate/tools';

ShutdownHook.subscribe(async (reason) => {
  await timer.wait(100);
  console.log(reason); // 'SIGINT'
});

process.kill(process.pid, 'SIGINT');

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

Readme

Keywords

none

Package Sidebar

Install

npm i @biorate/shutdown-hook

Weekly Downloads

10

Version

1.42.1

License

MIT

Unpacked Size

305 kB

Total Files

52

Last publish

Collaborators

  • llevkin