Compare semver version strings to find greater, equal or lesser.
- Runs in any Javascript environment.
- No dependencies.
- Tiny build size.
Supports the full semver specification including versions with different number of digits like 1.0.0
, 1.0
, 1
and pre-releases like 1.0.0-alpha
. Additionally supports the following variations:
- Wildcards for minor and patch version like
1.0.x
or1.0.*
. - Chromium version numbers with 4 parts, e.g. version
25.0.1364.126
. - Any leading
v
is ignored, e.g.v1.0
is interpreted as1.0
. - Leading zero is ignored, e.g.
1.01.1
is interpreted as1.1.1
.
npm install @jvanderen1/compare-versions
Please visit https://jvanderen1.github.io/compare-versions/
The following bundles are generated:
Module Type | File Name |
---|---|
ESM | compare-versions.mjs |
CommonJS | compare-versions.cjs |
UMD | compare-versions.umd.js |
This project would not be possible without the original compare-versions
project! Thank you.