Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Exit A Node Script

Use this for a hard exit that kills any async stuff that's running

Code

process.exit()

More here

https://nodejs.dev/learn/how-to-exit-from-a-nodejs-program

TODO: Look at that for more better ways to exit an app without the hard slam