×

difference between Dependency and DevDependencies

Introduction

There is a file named package.json present in every web project. It contains all the data needed for the project, which is also called metadata. All the dependencies needed for this project are present in that file. There are three types of dependencies present in that file. We are going to learn about only dependencies, and dev dependencies.

The following commands are used to run the projects:

npm init -y
{
“name”: “demo”,
“version”: “1.0.0”,
“main”: “index.js”,
“scripts” :{
 “tests”: “echo” Error: no test specified” && exit 1 “
},
“author”: “”,
“license”: “ICS”,
“keyword”: [],
“description”: “”
}

Dependencies

There is an object called dependencies in the file project.json. It contains all the related information needed for the web development project, including the version name. So whenever we install the library file for any project, we must find the project.json file. 

Syntax:  

npm install 

We can install the project by using the following command:

npm install moment

After the module installation is complete then we can start the structure of the package.json file by using the following command:

“dependencies”: {
“moment”: “2.23.0”
},

DevDependencies

There is an object called dev dependencies in the file project.json. It contains all the related information that is used for the development proposal. So whenever we install the development file for any project, we must find the project.json file. 

We can add more dev dependencies files by using the following command.

npm install  --save-dev

Example

We can install the bootstrap module that is used only for development proposed by using the following command.

npm install bootstrap --save-dev

After completion of the installation of the bootstrap package, then we can start the installation of the version of the package.json file by using the following command.

“devDependencies”: {
“bootstrap”: “4.3.1”
},

Now we can summarize the difference between dependencies and dev dependencies below.

Dependencies vs. devDependencies

Dependencies devDependencies
It is a library package that is used for the project to need to function effectively. It is a development package for the project to the project’s development.
If a package does not have any node file, then it automatically adds the node file. If we install the npm package, then dev dependencies automatically installs all the required files.
When we run the program, then these library files are needed. These packages are needed during the development phase, not in the execution phase.
The package includes the final code. It also includes the final code.
Dependencies can be added to your project by running the below command. npm install   Dev dependencies can be added to your project by running the below command. npm install --save-dev  

Related Topics

Difference between Multimedia and Hypermedia

From the widespread usage of desktop computers in the late 1950s to the complex, sophisticated systems of today, technology has advanced significantly. The modern conveniences and the exponential global growth...

3 minutes read.

Difference between GPS and DGPS

What is GPS, and how is it operated? Positioning and navigation are become crucial aspects of our daily lives. Today, GPS is the most widely used utility for everyone. A person...

3 minutes read.

Difference between Persistent and Non-Persistent Connection

We all use the internet, and we usually search on the internet for different things. It looks so easy when we search anything on the internet. It is all right...

3 minutes read.

Difference between Research Papers and Technical Papers

What are Research Papers? Research papers are pieces of writing that document the findings of in-depth investigations on a particular topic. In most cases, they take a previously unresolved problem in...

2 minutes read.

Desktop OS vs Embedded OS

The difference between a desktop operating system and an embedded operating system is explained in this article. But, before we get into the differences, it's very important to know the...

6 minutes read.

Difference between UART and USART

Universal Asynchronous Receiver Transmitter is referred to as UART. Universal Synchronous Asynchronous Receiver Transmitter is referred to as USART. They are merely a piece of hardware that transforms parallel data...

3 minutes read.

Difference Between Center and Centre

Difference Between Center and Centre For centuries, the different spelling of same word have confused so many writers. We often confuse about which spelling is correct? Where we should use center...

4 minutes read.

Difference between Vision and Mission

Difference between Vision and Mission These words are really important for every organisation. Now a day, in fast-paced environment, every organisation must have a clear or pinned statement which is attractive. There...

6 minutes read.

Difference between Static Friction and Limiting Friction

Friction exists in between the two objects when there is a contact in between them. There are different types of frictions based on the different factors like the Motion, Force,...

3 minutes read.

Difference between Extender and Repeater

Nowadays, we all use Wi-Fi in our houses and offices. We can easily connect and use the internet without any wire connection between the gadgets and the router. So, the...

4 minutes read.

Difference between Permutation and Combination

Permutation The permutation is an action of arranging all or a few members of a set within a linear order. In other words, it is a selection process in which sequence...

1 minute read.

Glucose vs Fructose

Difference between Glucose and Fructose ‘Fructose’ and ‘glucose’ are both monosaccharide sugars with a simple structure. When starch and sugar, whether sucrose or high-fructose corn syrup (HFCS), are digested, they produce...

4 minutes read.

Difference between India and Australia

Difference between India and Australia India India is a large country in Asia Continent. A Portuguese explorer VascodeGama was the first European who reach India. He reached Calicut (India) in July 1497...

5 minutes read.

Difference between Hematite and Magnetite

What are Iron ores? Iron makes up a large portion of both the Earth's outer and inner cores, making it the most prevalent element on Earth by mass, just ahead of...

3 minutes read.

Difference between Impact and Non-Impact Printer

Depending on whether the picture produced is created by pressing an ink ribbon on the paper, printers are divided into two categories. There are two different types of printers: impact...

3 minutes read.

Food Allergy VS Food Intolerance

Difference Between Food Allergy and Food Intolerance A food allergy arises when the body's immune system, which normally fights diseases, sees food as an invasion. When the immune system reacts to...

3 minutes read.

Email vs Gmail

Difference between Email and Gmail There are many methods of connecting and messaging digitally. The two most famous are Email & Gmail. These two platforms are used for professional as well...

3 minutes read.

Difference between PLA and PAL

In computer engineering, the logic gates are used in different cases. The PLA and PAL are the programmable logic devices having different functionalities. These are mostly used in dealing with...

3 minutes read.

Difference between Training and Development

In order to give employees proper skills and knowledge, and help them to make the most of it, training and development must be very necessary. Along with job-related training, an...

3 minutes read.

Difference between Associative Mapping and Direct Mapping in Cache

This article gives the brief explanation about the Associative and Direct mapping techniques. We will get a brief understanding about associative and direct mapping after going through this article. What is...

3 minutes read.