Semantic version checker
Check which versions match an npm-style range like ^1.2.0 or ~1.4, and find the highest match.
How it works
A caret allows changes that don’t modify the first non-zero number; a tilde allows patch changes only. Pre-release versions only match ranges that mention them.
Questions
What does ^0.3.1 allow?
Below 1.0 the caret is stricter: ^0.3.1 allows 0.3.x from 0.3.1 up, but not 0.4.0.
Why doesn’t 3.0.0-beta match?
Pre-releases only match a range that names a pre-release of the same version.