715 B
715 B
SmartExit - Development Hints
Logging System
The module uses consolidated logging with a [smartexit] prefix:
- Default behavior: Logs a single summary line on shutdown
- Silent mode: Pass
{ silent: true }to constructor to disable all logging
Example output
[smartexit] Shutdown complete: killed 3 child processes, ran 2 cleanup functions
Usage
// Default - logs summary
const smartExit = new SmartExit();
// Silent - no logging
const smartExit = new SmartExit({ silent: true });
killAll() Return Value
The killAll() method returns stats about the cleanup:
const { processesKilled, cleanupFunctionsRan } = await smartExit.killAll();