HTTP Graceful Shutdown

JSON →
library 3.1.16 ·javascript
verified May 27, 2026

http-graceful-shutdown is a Node.js utility library designed to ensure HTTP and HTTPS servers (including those built with frameworks like Express, Koa, and Fastify, or native Node.js http/http2) shut down cleanly and without disrupting active client connections. It manages open sockets, stops accepting new connections, and allows for the registration of custom cleanup functions (e.g., closing database connections) to execute before the server fully terminates. The library tracks all connections, gracefully communicates shutdown intent to clients, and can optionally destroy remaining sockets forcefully after a timeout. Version 3.1.16 is the current stable release, with version 3.0 being a significant update that improved internal handling while maintaining backward compatibility with 2.x. It has seen over 35 million downloads, indicating its widespread adoption for robust application termination. The release cadence appears stable, with major versions being well-tested.

total hits 12
actors 7 distinct systems
last hit 3d ago AhrefsBot
GPTBot
2
Script
1
MetaBot
1
Search engines
1

top countries 🇩🇪 Germany · 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France