How Semantic Versioning Works
SemVer (Semantic Versioning) is the standard for communicating change intent in software libraries and APIs. Every version string carries a contract with your users.
What is a breaking change?
Any MAJOR version bump (1.x.x → 2.0.0) signals that existing code may break. APIs may have been removed, renamed, or behaviorally changed. Always read the changelog before upgrading.
When is it safe to auto-upgrade?
PATCH upgrades (1.2.3 → 1.2.4) are always safe — bugs fixed, no API changes. MINOR upgrades (1.2.x → 1.3.0) add features but stay backward-compatible. MAJOR = manual review required.
What does ^ mean in package.json?
Caret (^1.2.3) allows MINOR and PATCH upgrades — anything from 1.2.3 to <2.0.0. Tilde (~1.2.3) allows only PATCH upgrades — 1.2.3 to <1.3.0.
Pre-release versions
Tags like 1.0.0-alpha.1, -beta.2, -rc.1 are lower precedence than the release version. They signal instability. Never use pre-release in production without testing.
0.x.x versions — the wild west
When MAJOR is 0, anything goes — APIs are considered unstable. A 0.1.0 → 0.2.0 bump can contain breaking changes. Treat every change as potentially breaking during initial development.
Build metadata
The +build.42 suffix is ignored for precedence comparisons. Two versions identical except for metadata are considered equal in SemVer. Useful for CI/CD pipelines to track builds.