Save time: npm install nodemon

Nodemon will allow you to start your node.js project without manually shutting down and restarting your server.

Many people are scared of installing nodemon GLOBALLY, so here’s a guide to install nodemon locally in your node.js project.

You took two paths to get here: 1. You used the express generator, 2. You started your own express server

Path 1: You used the express generator

Step 1: Install nodemon

npm install nodemon --save

Step 2: Change your “start” npm command to use nodemon inside the “scripts” object

"start": "nodemon ./bin/www

note: you might have to create this command

Step 3: Run your new dev script

> npm start

Path 2: You started your own express server

Step 1: Install nodemon

npm install nodemon --save

Step 2: Create a “start” npm command to use nodemon pointing to your express file (inside the “scripts” object)

"start": "nodemon index.js

note: you will have to create this command

Step 3: Run your new dev script

> npm start

 

Your javascript changes will automatically restart your server.

 

*You’re welcome Ken.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s