Sometimes, we want to exit a Node.js program.
In this article, we’ll look at how to exit a Node.js program.
How to exit a Node.js program?
To exit a Node.js program, we can call process.exit
.
For instance, we run
process.exit()
to exit the program without any exit code.
Or we can write
process.exit(1)
to exit the Node.js program with exit code 1.
Conclusion
To exit a Node.js program, we can call process.exit
.
One reply on “How to exit a Node.js program?”
I read many articles on node.js installation, updates and many more but have not seen any blog on that about to exit a Node.js program. But you provide this information. Thank you.