Hey guys I am back with another blog post. In this post we will be discussing what is the difference between Node and Nodemon. Many young developers have this question in their mind and in the forums such as stackoverflow I have found this questions asked a lot by developers. So I decided to answer this question specifically by writing a complete blog post. Let’s start by discussing what is Node and Nodemon?

WHAT IS NODE ? 

Node is an open source , cross-platform Javascript runtime environment that executes Javascript code outside of a browser. Node is not a programming language. Also many developers think that it is a modern programming language. And also some people think that it is some kind of a framework of Javascript like React, Angular etc. But it is also not a framework. Rather Node is just a runtime environment which is built on Google Chrome’s JavaScript V8 Engine so that it can execute Javascript code outside of a Browser. Node provides additional modules which a developer can make use to build powerful Asynchronous I/O (Input-Output) Data Intensive Applications. Node can be used to build these features:

Create your own server in node so that it can responds to user requests at particular

ports.

You can use Node to interact with the User’s File System.

You can use node to make networking applications as there is a http module available.

WHAT IS NODEMON ? 

Nodemon unlike Node is a package available in the Node Package Manager (NPM). It’s specific use is to automatically restart the node server without having to start the node server explicitly by typing the node commands. It greatly reduces the time and effort required by the developer in running the application. 

So the Question Arises how to install nodemon into node application and how to use it for better results?

CHECK NODE 

STEP-1

Make sure Node is installed into your computer. To check if it is installed there is a very simple command available to check it. The command is node –version. Just open the command prompt on the computer and type this command. You will see the version of node which is installed if the command is successful. If error comes then node is not installed so just go to it’s official website and download the latest version of Node. 

MAKE NEW NODE PROJECT 

STEP-2 

Make a new Node project by creating a new directory and then open any code editor specifically for this tutorial I am using Visual Studio Code. And make a new Javascript file inside the directory name it anything for example server.js. This will be the server we will be making in Node. 

RUNNING NODE APPLICATION 

STEP-3

After writing all the code in the server.js file. You want to run this file. To run it simply open the termional and type node server.

OPEN APPLICATION IN BROWSER 

STEP-4

Just open the application at the port number you have mentioned in the browser. The address will be localhost:8080

DOWNLOAD NODEMON PACKAGE 

STEP-5

After running the application we need to install the nodemon package so that you don’t need to stop the server everytime you make a change in the application. It should automatically do that for you. For that you should be installing nodemon. We will be installing nodemon with this command globally into the system. The command to install nodemon is npm install -g nodemon . Type it in the terminal and wait for some time.

RUNNING NODEMON  

STEP-6

After installing nodemon globally into the system. It’s time to get started with the application so just first of all stop the server by pressing ctrl+c and then enter the command nodemon server to start nodemon. You will see the following screenshot if your command is successful. 

RUNNING APPLICATION  

STEP-7

Now you have successfully configured nodemon into our application. So now everytime you make any kind of changes into your application then automatically those changes will be reflected back onto the browser without having to explicitly stop the server and then restart it to make the changes.

This is the end of the post and you have successfully understood what is the difference between node and nodemon and also you have implemented nodemon into your application. Thank you very much for reading this post and also please subscribe to our newsletter for receiving more posts like this.

A programmer scientist by the mind and a passionate blogger by heart ❤️. Fountainhead of Coding Shiksha Life motto: Live while you can! Teach & inspire while you could & Smile while you have the teeth.

Gautam Sharma

Founder , Coding Shiksha

1 Comment

  1. Sachin

    Not enough popups on the site dude. I’m disappointed.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *