Node.js Destroyable Server

JSON →
library 1.1.1 ·javascript
verified May 27, 2026

Destroyable-Server, currently at version 1.1.1, is a compact Node.js module designed to enhance the `net.Server` API by providing a reliable and immediate mechanism to terminate all active client connections. When `server.close()` is invoked, it merely ceases to accept new connections, often leaving existing ones open and preventing the Node.js process from exiting cleanly. This library introduces a `destroy()` method to server instances via its `makeDestroyable` utility, which not only stops listening but also forcibly closes every tracked socket. This capability is critical for scenarios requiring rapid server restarts, robust test suite teardowns, or graceful application shutdowns. It works across various `net.Server` subclasses, including HTTP and TLS, and uniquely offers a promise-based interface for awaiting complete connection termination, differentiating it from `server.closeIdleConnections()` which might miss active connections or not be universally available. The project maintains a stable, low-cadence release cycle, reflecting its focused utility and role as part of HTTP Toolkit.

total hits 19
actors 7 distinct systems
last hit 23h ago AhrefsBot
ByteDance
6
MetaBot
4
GPTBot
2
ChatGPT-User
2
Script
1
Search engines
1

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