compare-version
Compares two software version numbers (only number)
Install
$ npm install --save compare-ver
Usage
var compareVer = require('compare-ver');
compareVer("0.0.2","0.0.1")
compareVer("0.0.10","0.0.1")
compareVer("0.0.10","0.0.2")
compareVer("0.9.0","0.9")
compareVer("0.10.0","0.9.0")
compareVer("1.7", "1.07")
compareVer("1.0.07", "1.0.007")
compareVer("0.3","0.3")
compareVer("0.0.3","0.0.3")
compareVer("0.0.3.0","0.0.3.0")
compareVer("0.2.0","1.0.0")
compareVer('0.0.2.2.0',"0.0.2.3")
compareVer('0.0.2.0',"0.0.2")
compareVer('0.0.2',"0.0.2.0")
compareVer("1.07", "1.7")
compareVer("1.0.007", "1.0.07")
compareVer("0.0.2")
compareVer(1212,"0.0.2")
compareVer("0.0.2",1212)
compareVer('1.a.2',"1.0.2")
compareVer('1.0.2',"1.a.2")
License
MIT License © lmtdit
End.