I think NodeJs was initally designed to act as a webserver. You have to stop programs that you write with a Control/C.
But sometimes you want a script to end, either due to sa showstopper error, or because the process has completed.
Use the command
1 | Process.exit(0); // this is a forced exit. Not really recommended |
References