Releases: mrbar42/node-graceful
Releases · mrbar42/node-graceful
v3.1.0
v3.0.0
npm i -S node-graceful
yarn add node-graceful
- Typescript rewrite
- BREAKING minimize API to the
exit
event only - BREAKING remove support for callback in
exit
event - NEW FEATURE allow handling uncaught exceptions
- NEW FEATURE allow capturing unhandled rejections
- update README to reflect the new API
- more rigid tests
- TS typing now derived from the code
- optimise published files
Migration to v3
- to wait for asynchronous callbacks use
Promise
constructor
Graceful.on('exit', (done, signal) => {
server.close(() => done());
});
// now becomes
Graceful.on('exit', (signal) => {
return new Promise((resolve) => {
server.close(() => resolve());
});
});
- If you were using
Graceful
to listen to terminating events you can replace them with direct listeners onprocess
.
Graceful.on('SIGTERM', listener)
//now becomes
process.on('SIGTERM', listener)`
v2.0.1
v2.0.0: fix non-exiting bug, add tests for missing cases, bump breaking! (#13)
Usage:
npm install -S node-graceful
or
yarn add node-graceful
Changes:
- fix generic exit event behavior (Thanks to @k7sleeper @krazibitBD @mattgodbolt)