software-version-compare

Compare between two standard software versions and display out the result.

Usage no npm install needed!

<script type="module">
  import softwareVersionCompare from 'https://cdn.skypack.dev/software-version-compare';
</script>

README

Compares two software versions. Exports a function compareVersions and excepts two parameters(version1 and version2) in string format.

  • returns 0 if both are same
  • return 1 if v1 > v2
  • return -1 if v1 < v2
  • return false if invalid input except stringed version numbers