Semantic Versioning is a specification, which describes how version strings should be handled. It works by having MAJOR, MINOR and PATCH versions in a dot-separated string. Example:
I needed to store this string in a single 32-bit integer due to system limitations, so I wrote two handy, well-documented functions in ES6. Let’s convert the version string “2.5.3” into an integer:
let numericVersion = convertVersionToInt32('2.5.3'); // 3150850 let version = convertInt32VersionToString(numericVersion); // "2.5.3"