Understanding Semantic Versioning 2.0.0 (SemVer)
Semantic Versioning (SemVer) is a universal versioning specification formatted as MAJOR.MINOR.PATCH. It establishes a formal contract between library maintainers and consumers regarding backward compatibility:
- MAJOR: Incremented when making incompatible, breaking API changes.
- MINOR: Incremented when adding functionality in a backward-compatible manner.
- PATCH: Incremented when making backward-compatible bug fixes.
Caret (^) vs Tilde (~) in package.json
- Caret (
^1.2.3): Allows updates that do not modify the leftmost non-zero digit. For^1.2.3, npm will accept1.3.0or1.9.9, but blocks2.0.0. - Tilde (
~1.2.3): Allows only patch-level bug fixes. For~1.2.3, npm will accept1.2.9, but blocks1.3.0.