Node Process Cleanup Handler

JSON →
library 2.1.2 ·javascript
verified May 27, 2026

The `node-cleanup` package provides a mechanism to install custom cleanup handlers that execute when a Node.js process exits. This includes normal termination (exit code 0), error-induced exits (uncaught exceptions, exit code 1), and receipt of POSIX signals such as SIGINT (Ctrl-C), SIGHUP, SIGQUIT, and SIGTERM. The current stable version is 2.1.2, released recently, following a "complete rewrite" in version 2.1.0. Its release cadence appears to be driven by feature enhancements and major architectural changes rather than strict time intervals. Key differentiators include support for multiple independent handlers, asynchronous cleanup for signals (allowing postponement of process termination), delegation of termination decisions to child processes (useful for scenarios with tools like Emacs), and custom `stderr` messages for Ctrl-C and uncaught exceptions. The library focuses on robust and reliable process shutdown management in various scenarios.

total hits 16
actors 7 distinct systems
last hit 1d ago human
GPTBot
2
Script
1
ClaudeBot
1
Search engines
2
Humans
4

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