How to Exit a Node.js Program with an Exit Code
Every program ends with an exit code: 0 when it succeeded, anything else when it didn't. Shells, scripts and CI jobs read that number to decide what to do next, so a Node.js program that hits a problem should end with a non-zero code, such as 1.
