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.
| Version | In range | Parts |
|---|---|---|
| 1.2.2 | no | 1.2.2 |
| 1.2.3 | yes | 1.2.3 |
| 1.2.10 | yes | 1.2.10 |
| 1.3.0-beta.1 | no | 1.3.0pre beta.1 |
| 1.9.0 | yes | 1.9.0 |
| 2.0.0 | no | 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.