Introduction
In This Blog, We will understand more about the versioning of npm packages or any application.
[ Hello Buddies ]
Let's get started...
Now, Let's take an example of one npm package called "express".
We have an npm called "express" and its version is "^4.19.2".
Now, let's break down that version with the use of dot(.) and understand each part individually.
"^4.19.2"
- First Part = 4
- Second Part = 19
- Third Part = 2
The first part we can call a major part of the version.
1 - First Part > [ MAJOR ] = [ 4 ]
If in the future, "4" will become "5" it means that a major update will be there which might break the backward compatibility.
2 - Second Part > [ MINOR ] = [ 19 ]
It means that, if the current version is "19" and it will be 20 or more then it will have some minor fixes and it's recommended to update to the new version.
3 - Third Part > [ PATCH ] = [ 2 ]
It means that, if the current version is "2" and it will be 3 or more then it means that some small bug fixed will be there which will not affect any functionality and it's optional also so if we need to update then update it or it'll not affect anything.
Now, Let's understand the what is the meaning of "^" symbol in the version.
The caret (^) symbol means that it will accept only minor and patch updates. If there is a change in the MAJOR version, it will not accept it.
Thanks!!
Top comments (4)
Thank you, really simple and easy to understand !
Thank you for your appreciation :)
Really, it's very easy to understand.
Thank you for your appreciation buddy :)