If you ever noticed the version of a software, you must have noticed something like v1.1.0. Today we’ll see how they work. Versioning system like this is called a semantic versioning. In this system there are three numbers, the first one is called the Major version and the second one is called the minor version, and the third one is called the patch version or release. Let’s explain:
The patch version or patch release is for bug fixing, let’s say we have version 4.13.6 of a software and a bug was found, after fixing the bugs the version would be 4.13.7. So, when the developers fix a bug, they will increase the patch version. The Minor version is used for adding new features that will not break the existing software. So, after a minor update the version would be 4.14.0, notice the patch version is reset to 0? It’s because no bugs were found on this version yet, so it could be unstable and as soon as they find a bug, they will increase the patch version. Now if the update contains a breaking change in the software or If it’s a big update they will increase the Major version, so it’ll be 5.0.0.
Extra: In the node package file you will see something like "^4.12.6", this '^' is called the caret character, this means the PM is allowed to install update version of that software as long as the major version is 4. For example, when someone downloads a git repo long after it was uploaded and does npm install, the PM might install newer version like 4.21.6 keeping the major version same. Sometimes the '~' (tilde) character is also used to tell the PM to keep the major and minor version same. So if old version was like 4.12.6 it might install 4.12.16 depending on the software update. So the caret is used to denote 4.x.x and tilde is used to denote 4.12.x.
Top comments (0)