I'm running Node.js using VS Code on Windows.
Upon detecting an error condition, how can I completely stop the execution of the script at that point, except for writing a final error message to the console?
I would need to wait until there is a confirmation that the error message has been successfully displayed to the user, and then completely exit the rest of the script without any further execution of the the code past the successful console write?