version-transform
v1.0.1
Published
Transform version string to integer back and forth
Downloads
2
Maintainers
Readme
Version Transform
Transform version string to integer and integer to version string.
Tested on:
- Node 8
Usage
- Transform version to integer
const transform = require(`version-transform`);
transform.versionStringToInteger(`1.1.0`);
// Output:
// 6
- Transform version to integer (alternative)
const transform = require(`version-transform`);
transform.versionToInteger(1, 1, 0);
// Output:
// 6
- Transform integer to version string
const transform = require(`version-transform`);
transform.integerToVersionString(6);
// Output:
// 1.1.0