Source code Stability

process.exit in library code

Part of the Error handling & resilience check · fix arrives as a pull request

What it is

process.exit() is called from library or module code rather than from the application entry point.

Why it matters

It terminates immediately: in-flight requests are dropped, buffered logs are lost, and cleanup handlers never run. It also makes the module untestable, since the runner exits when the code path is reached.

How to fix it

Throw or return an error and let the entry point decide whether to exit. Where a shutdown really is warranted, signal it upward so the process can drain connections and flush logs first.

Run them all on your app

Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.