version2number
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

version2number

A npm package that converts version string to numbers

const v2n = require("version2number")

if (v2n("1.0.0") < v2n("1.0.2")) {
    console.log("1.0.0 is smaller than 1.0.2!")
}

console.log(v2n("1.0.0")) // 10000 which is 010000 + 0000 + 00

console.log(v2n("1.0.0", 1)) // 100 which is 100 + 00 + 0

View source code: https://github.com/OguzhanUmutlu/version2number

Package Sidebar

Install

npm i version2number

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

2.39 kB

Total Files

5

Last publish

Collaborators

  • oguzhanumutlu