Arbitrary precision
The three numbers are BigInt. 18446744073709551616.0.0 parses, prints and compares exactly.
moonsver
moonsver implements Semantic Versioning 2.0.0: it reads and prints versions, orders them by the precedence rules of the spec, and answers whether a version fits a range. Ranges come in four grammars. The numbers are arbitrary precision.
Loading the compiled library…
What it does
A version is a small, strict format. The work is in the edges: leading zeroes, prerelease ordering, build metadata, and the many ways a range can be written.
The three numbers are BigInt. 18446744073709551616.0.0 parses, prints and compares exactly.
npm, Cargo, Ruby and the strict standard are a setting on Syntax, not four forks of the parser.
^1.2.3 expands to >=1.2.3, <2.0.0. Read the sets back, or ask which versions fit.
Numeric identifiers before alphanumeric, a shorter list below a longer one, build metadata left out.
Major, minor, patch and the prerelease corners that are easy to miss, including 1.0.0-pre → 1.0.0.
Version and Range serialise as strings, so they drop straight into config files and API responses.
One string, four grammars
Ranges are not in the standard, so each ecosystem wrote its own. Type one and see how npm, Cargo, Ruby and the strict grammar each expand it — live, through the compiled library.
1.2.3, ~1.2, 1.2.* or ^1.2.3 || ^2
Playground
Paste versions, pick a range and a grammar, and watch the version axis light up. Every answer comes from the compiled package.