Mock JSON Generator
Describe a shape and get as many rows of matching JSON as you need.
Compare two semantic versions and test them against a range.
Caret, tilde, x-ranges, hyphen ranges, comparator sets and || unions are all understood.
The Semver Comparator compares two versions and tests them against a range, with the two rules that cause most of the surprises implemented properly — caret tightening below 1.0.0, and a prerelease only matching a range that already mentions one.
Compare two semantic versions, see which is higher and which part changed, and test whether a version satisfies a range — caret, tilde, x-ranges, hyphen ranges, comparator sets and unions all behave the way npm makes them behave.
Two rules cause most of the surprises. Below 1.0.0, a caret range tightens: `^0.2.3` allows 0.2.9 but not 0.3.0, because in a zero-major package the minor is treated as the breaking number. And a prerelease only satisfies a range that already mentions a prerelease on the same major.minor.patch — which is why `^1.0.0` does not match 2.0.0-rc.1 even though 2.0.0-rc.1 sorts below 2.0.0. Both are implemented here, along with the ordering rule that numeric prerelease identifiers compare numerically, so beta.11 correctly outranks beta.2.
^0.2.3 allows 0.2.9 but not 0.3.0, because below 1.0.0 the minor is treated as the breaking number. This is the rule most implementations get wrong.
^1.0.0 does not match 2.0.0-rc.1, so an untested release candidate is never installed just because it sorts below a version you allowed.
Numeric identifiers compare numerically, so beta.11 outranks beta.2 rather than sorting below it as a string would.
Caret, tilde, x-ranges, hyphen ranges, comparator sets and || unions, with the bounds each expands to shown.
What a major, minor, patch or prerelease bump would produce from where you are.
Any two semantic versions, with or without a leading v.
Which is higher, and whether the difference is major, minor, patch or prerelease.
Enter something like ^1.2.3 or >=2 <3 to see whether the version satisfies it, and what the range expands to.
The result shows what a major, minor, patch or prerelease bump would produce.
A caret allows anything up to the next major: ^1.2.3 covers 1.9.0. A tilde allows only patch changes: ~1.2.3 stops before 1.3.0. Caret is npm’s default because minor releases are supposed to be backwards compatible.
Because below 1.0.0 the API is not considered stable, so the minor number is treated as the breaking one. ^0.2.3 allows 0.2.x and stops at 0.3.0 — and ^0.0.3 allows only 0.0.3 exactly.
Always below the release they precede: 1.0.0-rc.1 is less than 1.0.0. Between prereleases, identifiers compare field by field, numeric ones numerically — so beta.11 is above beta.2, not below it as a string comparison would give.
By design. A prerelease only satisfies a range that already mentions a prerelease on the same major.minor.patch, so you never get an untested release candidate installed just because it happens to sort below a version your range allows.
What people who use the Semver Comparator think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the Semver Comparator. It takes half a minute and no account.
Write the first reviewDescribe a shape and get as many rows of matching JSON as you need.
Generate MAC addresses that are correctly marked as locally administered.
Run JSONPath expressions against a document and see every match live.
Generate prefixed API keys in the format modern providers use.
Check any number against the Luhn checksum and see the working.
Re-indent a SQL query into readable clauses, joins and conditions.
The full ASCII table with decimal, hex, octal, binary and HTML entities.
Read a cron expression in plain English and see when it next runs.