Gathering detailed insights and metrics for version-range
Gathering detailed insights and metrics for version-range
Gathering detailed insights and metrics for version-range
Gathering detailed insights and metrics for version-range
@changesets/get-version-range-type
Common get-version-range-type shared between changeset packages
bin-version-check
Check whether a binary version satisfies a semver range
@lerna/has-npm-version
Test if the current version of npm satisfies a given semver range
@resdir/version-range
VersionRange class used by Resdir
Check version ranges like `>=N` and `X || Y || Z` with support for Node.js, Web Browsers, Deno, and TypeScript.
npm install version-range
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
100
Quality
76.2
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
10,855,619
Last Day
9,792
Last Week
233,461
Last Month
919,672
Last Year
4,166,577
NOASSERTION License
2 Stars
36 Commits
1 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Oct 12, 2024
Minified
Minified + Gzipped
Latest Version
4.14.0
Package Id
version-range@4.14.0
Unpacked Size
81.15 kB
Size
15.26 kB
File Count
16
NPM Version
10.2.3
Node Version
20.10.0
Published on
Jan 07, 2024
Cumulative downloads
Total Downloads
Check version ranges like >=N
and X || Y || Z
with support for Node.js, Web Browsers, Deno, and TypeScript.
Range comparison of versions for the most common use cases. Fast with broad ecosystem support.
1import satisfies from 'version-range' 2console.log(satisfies('1.0', '>=1.0')) // true 3console.log(satisfies('1.0', '1')) // true 4console.log(satisfies('1.0', '1 || 2')) // true 5console.log(satisfies('1.1.0', '^1.1')) // true 6console.log(satisfies('1.1.0', '~1.1')) // true 7console.log(satisfies('1.0.0', '5 || <=2')) // true 8 9console.log(satisfies('1', '<=2')) // true 10console.log(satisfies('1.0', '<=2')) // true 11console.log(satisfies('1.0.0', '<=2')) // true 12 13console.log(satisfies('2', '>1')) // true 14console.log(satisfies('2', '>=1')) // true 15console.log(satisfies('1', '>=1')) // true 16console.log(satisfies('1.0', '>=1')) // true 17console.log(satisfies('1.0.0', '>=1')) // true 18console.log(satisfies('1', '>=1.0.0')) // true 19console.log(satisfies('1.0', '>=1.0.0')) // true 20console.log(satisfies('1.0.0', '>=1.0.0')) // true 21 22console.log(satisfies('1', '^1')) // true 23console.log(satisfies('1', '~1')) // false, not all 1.x versions (1.1, 1.2, etc) match 1.0.x 24console.log(satisfies('1', '^1.1')) // false, not all 1.x versions (1.0) match >=1.1<2 25console.log(satisfies('1', '~1.1')) // false, not all 1.x versions (1.0) match 1.1.x 26console.log(satisfies('1.0.0', '^1')) // true 27console.log(satisfies('1.0.0', '~1')) // true
The above results are expected, but not what the semver
package returns. The semver package has two different behaviours based on whether the version is coerced or not, alternating between expected and unexpected results. This package differs to match our actual expectations, as you can see above.
Doesn't do special handling for -releaseTag
and 0.x
versions.
This package comprises this suite of related packages:
And if you are specifically interested in Node.js and ECMAScript versions:
npm install --save version-range
import pkg from ('version-range')
const pkg = require('version-range').default
1import pkg from 'https://unpkg.com/version-range@^4.14.0/edition-deno/index.ts'
1<script type="module"> 2 import pkg from '//cdn.skypack.dev/version-range@^4.14.0' 3</script>
1<script type="module"> 2 import pkg from '//unpkg.com/version-range@^4.14.0' 3</script>
1<script type="module"> 2 import pkg from '//dev.jspm.io/version-range@4.14.0' 3</script>
This package is published with the following editions:
version-range/source/index.ts
is TypeScript source code with Import for modulesversion-range/edition-browsers/index.js
is TypeScript compiled against ES2022 for web browsers with Import for modulesversion-range
aliases version-range/edition-es5/index.js
version-range/edition-es5/index.js
is TypeScript compiled against ES5 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesversion-range/edition-es2022-esm/index.js
is TypeScript compiled against ES2022 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for modulesversion-range/edition-types/index.d.ts
is TypeScript compiled Types with Import for modulesversion-range/edition-deno/index.ts
is TypeScript source code made to be compatible with DenoDiscover the release history by heading on over to the HISTORY.md
file.
Discover how to contribute via the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
and licensed under:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
-10.6%
9,792
Compared to previous day
Last Week
0.1%
233,461
Compared to previous week
Last Month
41.6%
919,672
Compared to previous month
Last Year
969.4%
4,166,577
Compared to previous year