@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)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.42.1355latest

Version History

VersionDownloads (Last 7 Days)Published
1.42.1355
1.30.127
1.29.05
1.28.11
1.28.01
1.27.11
1.27.01
1.26.01

Package Sidebar

Install

npm i @biorate/shutdown-hook

Weekly Downloads

372

Version

1.42.1

License

MIT

Unpacked Size

305 kB

Total Files

52

Last publish

Collaborators

  • llevkin