[TIL] Semantic Versioning

[TIL] Semantic Versioning

Versions of the npm packages in the dependencies section of the package.json file follow Semantic Versioning (aka SemVer). An industry standard for software versioning aims to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer for smooth communication and expect possible changes on the project if they update the project.

"package": "MAJOR.MINOR.PATCH"
  • The MAJOR version should increment when we make incompatible API changes.

  • The MINOR version should increment when you add functionality in a backward-compatible manner.

  • The PATCH version should increment when you make backward-compatible bug fixes.

    💡
    This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that won’t work with earlier versions.

Useful SemVer Cheatsheet

Sources: Freecodecamp.com, semver.org