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
Copyright (c) 2021-present Leonid Levkin (llevkin)