@jvanderen1/compare-versions
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Build Test Coverage Status npm bundle size (minified + gzip)

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 or 1.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 as 1.0.
  • Leading zero is ignored, e.g. 1.01.1 is interpreted as 1.1.1.

⬇️ Install

npm install @jvanderen1/compare-versions

📕 Documentation

Please visit https://jvanderen1.github.io/compare-versions/

🤝 Compatability

The following bundles are generated:

Module Type File Name
ESM compare-versions.mjs
CommonJS compare-versions.cjs
UMD compare-versions.umd.js

🙌 Acknowledgment

This project would not be possible without the original compare-versions project! Thank you.

Package Sidebar

Install

npm i @jvanderen1/compare-versions

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

27.4 kB

Total Files

7

Last publish

Collaborators

  • jvanderen1