To automatically detect file changes and restart the app you will need a process manager to start your NodeJS app
Note: Do auto restart only on your dev deployment. Never do it in production
npm install pm2 -g
pm2 start app.js --watch
You can also use pm2 to start non-nodejs app
pm2 start app.py --interpreter python
npm install -g nodemon
nodemon app.js
You can also use nodemon to start non-nodejs app. e.g. starting a python app:
nodemon --exec "python -v" ./app.py