SemVer stands for Semantic Versioning. NPM stands for Node Package Manager.
Because there can be different versions of a module that is installable, and the need to install various versions can differ, there exists what we call SemVer.
NPM is used to install packages or modules in NodeJS.
SemVer is the standard for versioning node packages or modules. It is the reason there are different versions for node modules when you install any package using NPM.
Let’s install Express.
Do the following using your terminal:
mkdir semver
cd semver
npm init -y
npm i express
From the image above, we can see that the version number of the express package we installed is 4.17.1.
4.17.1 = MAJOR.MINOR.PATCH
The 4 refers to MAJOR
, the 17 refers to MINOR
, and the 1 refers to PATCH
.
MAJOR
– This means that there is a change in API compatibility.MINOR
– This means that there is new functionality added and that it is backward compatible.PATCH
– This refers to a bug fix. When this part of the version number increases, it means that a bug has been fixed.