Semantic versioning in one minute
SemVer is MAJOR.MINOR.PATCH: bump MAJOR for breaking changes, MINOR for backward-compatible features, PATCH for bug fixes. Pre-release tags (-beta.2, -rc.1) sort before the final release. Comparison is numeric, segment by segment, left to right — 2.10.0 > 2.9.9 because 10 > 9, never string order.
Range operators
- Exact
1.2.3— only that version. - Caret
^1.2.3— compatible: <2.0.0 for a 1.x (allows 1.9.9, blocks 2.0.0).^0.2.3stays <0.3.0. - Tilde
~1.2.3— patch-level: <1.3.0.~1.2is the same as~1.2.0. - Wildcards
1.2.x,1.*— any matching segment. - Comparators
>=1.0.0 <2.0.0— explicit bounds. - OR
||— either range matches.
Why it matters
Lockfiles and package managers resolve ranges every install. Knowing what ^ actually allows — and that ^0.x behaves like ~0.x — prevents surprise upgrades (or missing security patches) in your dependencies.