To run Node.js app forever when console is closed, we use the forever
package.
For instance, we run
sudo npm install -g forever
to install forever
globally.
Then we run server.js even when the console is closed with
forever start server.js
And we stop it with
forever stop server.js
We see the list of running processes with
forever list