Three Nodemon Useful Options

Nodemon is a useful tool to react to code changes. I use it all the time when working on Nodejs backend.

Here are three useful options I have learnt today:

--exec allows one to run non node code.

ex: nodemon --exec 'mocha tests/*' (note the single quotes after the exec option)

--ignore to ignore changes made to a file whose name follow a specific pattern.

ex: nodemon --ignore README.md --ignore package.json. Note that you must repeat the option for every new pattern.

--watch to react only on changes made to the files whose name follow a specific pattern.

ex: nodemon --watch src/*.

The nodemon package documentation can be found here.