FM Field Manual smhansen.dev

FM 9-03 Chapter 9 · Web and developer

Semver

Parse and sort SemVer 2.0.0 versions and test npm ranges (^ ~ x || hyphen) against a list.

Local only Runs in your browser. Nothing you enter leaves this page.

Usable as a step in Chain
Normalised
>=1.2.3 <2.0.0-0
Allows
At least 1.2.3 and below 2.0.0, no 2.0.0 pre-releases
Pre-releases
Pre-release versions such as 1.2.3-beta never match this range.
Sorted by precedence, highest match 1.9.0
VersionIn rangeParts
1.2.2no 1.2.2
1.2.3yes 1.2.3
1.2.10yes 1.2.10
1.3.0-beta.1no 1.3.0pre beta.1
1.9.0yes 1.9.0
2.0.0no 2.0.0

Caret allows changes that do not modify the left-most non-zero part, so ^0.2.3 stays below 0.3.0. Tilde allows patch changes. A pre-release only matches when the range names a pre-release on the same major.minor.patch, as npm does. The -0 in <2.0.0-0 keeps 2.0.0 pre-releases out.

  • No entry in this manual matches “”.

↑ ↓ move · Enter open · Esc close