Restart a Node.js Application upon Changing a File
This tutorial will explain how to restart a Node.js application after changing a file using an npm Script and Nodemon. We can create a custom npm script to run our project during development. We will create a
start script, and a
dev script. Using an npm module called nodemon (named from the words node and monitor), we can restart our application automatically upon file changes.
By the end of this tutorial, you'll be able to:
- Understand how to create an npm script
- Describe how
devDependenciesare handled from npm scripts
- Describe why we might want nodemon to ignore files
Sign in with your Osio Labs account
to gain instant access to our entire library.