fastify-graceful-shutdown
Advanced tools
Comparing version 3.5.1 to 3.5.2
{ | ||
"name": "fastify-graceful-shutdown", | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"description": "Gracefully shutdown fastify", | ||
@@ -40,10 +40,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/node": "^18.7.18", | ||
"chai": "^4.3.6", | ||
"fastify": "^4.20.0", | ||
"@types/node": "^18", | ||
"chai": "^4.4.1", | ||
"fastify": "^4.26.2", | ||
"mocha": "^10.2.0", | ||
"np": "^8.0.4", | ||
"np": "^10.0.1", | ||
"pre-commit": "^1.2.2", | ||
"prettier": "^3.0.0", | ||
"tsd": "^0.28.1" | ||
"prettier": "^3.2.5", | ||
"tsd": "^0.30.7" | ||
}, | ||
@@ -50,0 +50,0 @@ "prettier": { |
# 🏹 fastify-graceful-shutdown | ||
<br/> | ||
> **Note**: If you are looking for a simple generic module to run shutdown logic, I recommend using [close-with-grace](https://github.com/mcollina/close-with-grace). `fastify-graceful-shutdown` goes an opinionated way, and does want to solve all use cases. | ||
<br/> | ||
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](#badge) | ||
@@ -14,2 +8,8 @@ [![NPM version](https://img.shields.io/npm/v/fastify-graceful-shutdown.svg?style=flat)](https://www.npmjs.com/package/fastify-graceful-shutdown) | ||
## Features | ||
- Graceful and debug friendly shutdown | ||
- Flush the fastify logger before process exit to avoid losing logs | ||
- Handlers are called in parallel for faster shutdown | ||
## Install | ||
@@ -32,3 +32,3 @@ | ||
fastify.gracefulShutdown((signal, next) => { | ||
console.log('Upps!') | ||
fastify.log.info('Received signal to shutdown: %s', signal) | ||
next() | ||
@@ -35,0 +35,0 @@ }) |
7270