A sync wrapper for gracefulExit that does not await the promised return but just fire and handle the async exit.
Useful for situations where you are in a sync context and need to trigger an async exit.
Optional
An optional error to log before exiting. If not provided, the process will exit with the specified code.
The exit code to use. Defaults to 1 if there's an error, or 0 if the exit is successful.
A sync wrapper for gracefulExit that does not await the promised return but just fire and handle the async exit.
Useful for situations where you are in a sync context and need to trigger an async exit.