Pikkola Semver, tool No. 56

Every version has a place in the order.

Type a version and see what each part of it is. Move it one step by major, minor, patch or prerelease. Put a range like ^1.4.0 against a list and find the highest match. Set two ranges side by side and see where they meet. Nothing is uploaded and nothing is stored.

3
benches
2.0.0
the spec
0
uploads

The studio

Three questions about a version

What is this version, what is the next one, and will it fit here. Each bench answers one and updates as you type.

01

Read a version, then move it one step

The string is split into its five fields. A bump follows SemVer's own rules, so a prerelease is dropped before a number moves.

Bump
Next version 1.4.2
Compare two versions

Order of weight major > minor > patch > prerelease build does not count
02

Match a range against a list

The same range lines npm and Cargo resolve. The list is sorted by precedence, each version gets a yes or a no, and the highest match is marked.

Examples

Reads as

Result

    03

    See where two ranges overlap

    Two teams, two dependencies, one version that has to satisfy both. If no version can, the reason is the gap between the two windows.

    Presets

    The axis is the versions the two ranges name, evenly spaced.

    Window both allow
    Lowest version that satisfies both
    Meeting windows

    Nothing leaves the tab

    No request, no account, no storage. The Content-Security-Policy sets connect-src to none, so the page could not upload a version even if it tried.

    What the order means

    SemVer is short, but the short part is exact. These are the rules the benches follow, and the ones a release note usually gets wrong.

    • 1
      Major, then minor, then patchEach field is compared as an integer. 1.10.0 is above 1.9.0 even though the text 1.10.0 sorts first.
    • 2
      A prerelease sits below its release2.0.0-rc.1 is lower than 2.0.0. Inside a prerelease, numeric identifiers compare as numbers and words compare in ASCII order, so rc.2 is below rc.10.
    • 3
      Build metadata does not count1.0.0+sha and 1.0.0 have the same precedence, because the specification says build metadata is ignored when versions are ordered. The compare bench still names the difference.
    • 4
      A caret on a zero^0.7.1 allows 0.7.9 but not 0.8.0. The leftmost number that is not zero may not move, so 0.x ranges are narrower than they look.
    • 5
      A tilde locks the minor~1.6.2 allows 1.6.9 and refuses 1.7.0. It is the range for a patch update you are willing to take without reading.
    • 6
      A prerelease needs to be named^1.4.0 will not pick 1.5.0-rc.1. A prerelease only matches when a comparator in the same range names that same major.minor.patch with a prerelease, or when the option is on.

    Questions

    Is the version or the list sent anywhere?

    No. There is no endpoint to send it to. The parser, the range engine and the page are files on this domain, and the Content-Security-Policy sets connect-src to none. Load the page once and it keeps working with the network off.

    Which version of SemVer is this?

    Semantic Versioning 2.0.0. A leading v is accepted and dropped, because package manifests write it. Leading zeros in a number are refused, an empty identifier is refused, and only letters, digits and hyphens are allowed inside an identifier.

    Which range syntax is read?

    Caret, tilde, x-ranges, hyphen ranges, comparators joined by a space or a comma, and alternatives separated by two vertical bars. npm and Cargo use the same shapes for these, so a range written for one reads the same here.

    What does the lowest version in an overlap mean?

    It is the smallest version that satisfies both ranges. When two dependencies have to share one copy, that is the version you can pin to, so it is more useful than a range nobody can read.

    Does it resolve a lockfile or peer dependencies?

    No. It reads range text, not a package tree, and it never asks a registry. Transitive dependencies, peer conflicts and dist-tags such as latest are outside what a range alone can decide.

    Why is 1.10.0 higher than 1.9.0?

    Because each field is a number. Ten is more than nine, even though the string 1.10.0 comes before 1.9.0 if you sort the text. The list in bench two is sorted by precedence, not alphabetically.