fjordtools / DevOps / Semver Range Tester

Semver Range Tester: Does This Version Match?

Check which versions satisfy an npm semver range such as ^1.2.3, ~1.2 or >=1 <2. Shows what the range means, handles pre-releases, and finds the highest match. Runs in your browser.

Range · npm style: ^1.2.3, ~1.2, 1.x, >=1 <2, 1.2 - 3, ||
Versions · one per line
Result
The range means

    
About Semver Range Testerhow it works and good to know

Range syntax

^1.2.3 allows changes that do not touch the left-most non-zero number: >=1.2.3 <2.0.0. ~1.2.3 allows patch changes: >=1.2.3 <1.3.0. 1.x and 1.2.* are wildcards, 1.2 - 2.3.4 is an inclusive range, >=1 <2 combines conditions (all must hold), and || joins alternatives. For 0.x versions the caret is stricter: ^0.2.3 stays below 0.3.0.

Pre-releases

A version like 1.3.0-beta.1 only matches a range if that range names a pre-release of the same major.minor.patch, for example >=1.3.0-beta.0. This is why ^1.2.3 does not install a beta. Switch on "Include pre-releases" to see what would match without that rule.

Precedence

Versions are compared as SemVer 2.0.0 describes: numbers first, then a pre-release sorts before its release, numeric pre-release parts sort before text ones, and build metadata (+build) is ignored.

Accuracy

The matching follows the rules of the semver package that npm uses, and is tested against it on tens of thousands of random ranges. Nothing is uploaded.

Related tools