Showing posts with label Semantic Versioning. Show all posts
Showing posts with label Semantic Versioning. Show all posts

Saturday, September 4, 2021

Semantic Versioning

What is Semantic Versioning?

Semantic Versioning uses the format major.minor.patch:

  • MAJOR version for incompatible API changes
  • MINOR version for added backward-compatible functionality
  • PATCH version for backward-compatible bug fixes

How npm Uses Semantic Versioning

In package.json, dependency ranges control allowed updates:

  • Patch-level: "~1.2.3" or "1.2.x" → versions ≥1.2.3 <1.3.0
  • Minor-level: "^1.2.3" or "1.x" → versions <2.0.0
  • Major-level: "*" or "x" → any version