0.1.0 • Published 8 years ago

version-int v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

version-int

parse a version string to int

API

version-int.parse(versionStr, digitLength) ⇒ number

parse a version string into a number

Kind: static method of version-int
Returns: number - version number

ParamTypeDefaultDescription
versionStrstringversion string
digitLengthnumber3how long each sub-version is

Example

versionInt.parse('1.1.1');    // 1001001
versionInt.parse('1.1.1', 1); // 111
versionInt.parse('1.1.1', 2); // 10101
versionInt.parse('1.2.3456', 3); // 1001345

version-int.setDigit(digitLength)

set/update default digitLength

Kind: static method of version-int

ParamTypeDefaultDescription
digitLengthnumber3how long each sub-version is

Example

versionInt.parse('1.1.1'); // 1001001
versionInt.setDigit(1);
versionInt.parse('1.1.1'); // 111