/semverex

Primary LanguageJavaScriptMIT LicenseMIT

The library is a tool to find greater, lesser or equal semver formatted versions. Comparing with the semver the library extended with following updates:

  • Accept Chromium version format (e.g. 10.20.30.40).
  • Accepts two digits versioning (e.g. 1.2).
  • Ignores leading letter, like v1.0.0.

Methods

  • max(string[])
  • min(string[])
  • eq(string[])
  • validate(string)

Syntax

compare.eq(["1.1.0", "1.1.0", "1.1"]); // true
compare.eq(["v1.1", "1.1"]); // true
compare.min(["0.1.0", "1.0.0"]); // 0.1.0
compare.max(["1.1.5", "1.0.1"]); // 1.1.5

Exceptions

Examples and edge cases

The library accepts semver extended with additional use cases. Please see the tests for more information.

npm run test

Contribution

Every contribution is welcome and appreciated. Please note: make sure your code covered with test before contributing.