Semver range checker
Check whether versions satisfy an npm style range like ^1.2.3, ~2.0 or >=1.4 <2, with a plain English reason for every answer.
Questions
What is the difference between ^ and ~?
A tilde allows patch updates: ~1.2.3 means 1.2.3 up to but not including 1.3.0. A caret allows anything that keeps the left-most non-zero number: ^1.2.3 allows up to 2.0.0, ^0.2.3 up to 0.3.0, and ^0.0.3 only 0.0.3.
Why does 2.0.0-beta.1 not match ^1.2.3 or *?
npm follows a prerelease rule: a version like 1.3.0-beta only matches a range that itself names a prerelease of 1.3.0, such as >=1.3.0-beta.0. That stops you from picking up unstable versions by accident. Tick Include prereleases to switch the rule off, like npm's --include-prerelease.
Does it behave exactly like npm?
It follows the rules of node-semver, which npm uses: x-ranges, tilde, caret, hyphen ranges, || unions and the prerelease rule. It uses strict version parsing, so loose forms such as 1.2 or 01.2.3 are reported as invalid versions.