Stop the current process with code as the exit code

exit(code)

Examples

// Stop with an error
exit(1); 

// Stop with a success
exit(0);

Notes

This is similar to process.exit but I found having a convenience wrapper for it made mocking calls in tests easier.