title: In Node.js How can I stop the script execution, successfully write an error message to the console, and then exit the script?
body: <p>I'm running Node.js using VS Code on Windows.</p>
  <p>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?</p>
  <p>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?</p>