automatic compile nodejs when edit

Install Nodemon package using the following command:

npm install -g nodemon

Add a new script to your package.json file:

"scripts": {
  "dev": "nodemon app.js"
}

Run the application using the nodemon command:

npm run dev