using forever module for windows in nodejs
To build on top of @richmb's answer. You can install it locally and then add it as a npm script in your package.json :
"scripts": {
"forever" : "forever"
},
Then , you can call it with npm run forever
Example :
npm run forever start app.js
npm run forever list
etc..
Forever needs to be installed globally. Install it with the -g
flag i.e. npm install forever -g
Correct syntax is forever start app.js, but for some reason it doesn't work on Windows. No error message, but the application doesn't run.
There was a bug in forever (on windows). Forever-win is a windows compatible version for it. Try below commands on windows command prompt, hopefully you should be able to run it successfully.
Install 'forever' and 'forever-win' globally
npm -g install forever
npm -g install forever-win
Start app using forever
cd <<project directory>>
forever start <<app.js>>