NPM Semantic Versioning
Like every code, npm packages also need to be updated. Whether it's rolling out a new feature or fixing the bugs in the existing ones, package authors update their packages. But since almost every package itself is dependent on many other packages developed by other developers so if not versioned carefully might break the package.
You can see the versions of your favorite package either on the versions tab on the npm website or on the Github repository of the project you might find a changelog file which is a documented file of all the notable changes.
NPM follows semantic versioning. These are a simple set of rules and requirements that dictate how version numbers are assigned and incremented.
Each version contains 3 digits separated by a dot ~
For example, suppose the current version of an npm package is
- 7 is the Major version
- 14 is the Minor version
- 6 is the Patch version
- The changes are not backward compatible
- The changes are big
- features are added in a backward-compatible manner
- you make bug fixes that are backward compatible
- you don't break the old code
If the current version is
7.14.6 and if the update is a:
- Major one, 7 is incremented to 8 while 14 and 6 are reset back to 0 i.e,
- Minor update, then 14 is incremented to 15 while 6 is reset back to 0 i.e,
- Patch update, then only the patch version is incremented i.e,
If you found this article helpful, I would be grateful for your support.
"Buy me some paneer curry"
I'd love to read your thoughts on this article!!!