Most node.js developers use Nodemon as a development server, as it allows you to watch your project files and will automatically restart Node when changes are detected. However, there are a few problems with this. Restarting an application every time a file changes is often unnecessary, and causes a slight delay before you can refresh your page (as database connections are restored and such).
Luckily, we can add a file called .nodemonignore in our project folder, which will tell Nodemon to ignore changes to specific files and folders. Here’s a sample file:
/node_modules/* /public/* /views/* /.git/* /.gitignore /package.json /Profile /README.md
In general, it’s pretty safe to ignore your template folder and static asset directory, as well as the git directory (no point in restarting your node server whenever you git commit). I opt to ignore my node_modules folder as well, so there are less files to watch (I was going over the max limit for my OS).