{"_id":"compare-ver","_rev":"10-80607d59a0f849a272ea41cbb5e84c4e","name":"compare-ver","description":"Compares two software version numbers (only number)","dist-tags":{"latest":"2.0.2"},"versions":{"0.0.2":{"name":"compare-ver","version":"0.0.2","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/test.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{"karma":"^0.12.37","karma-chrome-launcher":"^0.1.12","should":"^4.6.5","karma-mocha":"^0.1.10"},"_id":"compare-ver@0.0.2","_shasum":"7b77a510175a368f5675161d4162b9cb6299402a","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"7b77a510175a368f5675161d4162b9cb6299402a","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-0.0.2.tgz","integrity":"sha512-a1NtXI0WSxeAsUpM7hiuSxlr8l0zT8yCYWm3MpMwrCQACa8EswAJhsk4Tv86hE81lOcNVRLQHJR7SnsnvuLZMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIExAi/ABBFMKKQKrR67Fe9VrlJU1UQPygYMZbsrh1iKfAiAUmqq4BohtDvJRnZuYmiXYsT1arXTNm4HclzhUIGrDEA=="}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]},"1.0.0":{"name":"compare-ver","version":"1.0.0","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/test.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{"karma":"^0.12.37","karma-chrome-launcher":"^0.1.12","should":"^4.6.5","karma-mocha":"^0.1.10"},"gitHead":"a331f3f0f2b2ce2d8da14c328dfb3811dfe3f437","_id":"compare-ver@1.0.0","_shasum":"2c70594a891f62d02fc6251031af47ddda1fe208","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"2c70594a891f62d02fc6251031af47ddda1fe208","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-1.0.0.tgz","integrity":"sha512-UumBVz8BRodOLbhtMinfSiywdDcEt4Q63xmcZZAf2ZKicyRKUevV0J9sHKAeBiz2kWcmqDmumtBTZhRUj2MxEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHB+8AWejtoh2w3vWcy854X22SuM9GtPDIgVcJLVzqFwIhAL5hjK+dTR18qJx2QQLTpqaA2YBHLKMyuKH6v82nwGLU"}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]},"1.0.1":{"name":"compare-ver","version":"1.0.1","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/test.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{},"gitHead":"a331f3f0f2b2ce2d8da14c328dfb3811dfe3f437","_id":"compare-ver@1.0.1","_shasum":"45dd1c203843ffba57a79a9d05d98c3e3e56d8b1","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"45dd1c203843ffba57a79a9d05d98c3e3e56d8b1","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-1.0.1.tgz","integrity":"sha512-l/x34tMnoKeu/b11emLMzTu8Dj2uRQa8m+FcQt6Mw8COYnkN/vcQwX8LIg5bsq5DnncVGIk/ZdQP0bNNnYIH0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZegnmIBE/FcAhX+W5npklUsl1a2zJoylXzUu54UKLEAiEA/anfi3+psLeO2bWhG2MTw0teNm5H4o5o8H9cD+a0tME="}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]},"1.0.2":{"name":"compare-ver","version":"1.0.2","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/test.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{},"gitHead":"e4aac85c73a073d743e9516475772ea08aaf7240","_id":"compare-ver@1.0.2","_shasum":"a775925b7885e1893a21fddadeffe661a2445e88","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"a775925b7885e1893a21fddadeffe661a2445e88","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-1.0.2.tgz","integrity":"sha512-1qTPlEWEg7sppUEDXVKhetN8nHA8hRKFLS4fFMAnluuoXh5akgAP136aYT7kZeRcqqQDqeO21mi9uxiPCNCfBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZfpvfrXiQwD94Ujlew/kEGKEOj639CSSQe0qIVwYmxAiAW+HksCy0BLZq2mrNET/eqOVdWYLfpkEz5BM94p6zcog=="}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]},"2.0.0":{"name":"compare-ver","version":"2.0.0","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/test.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{},"gitHead":"9b8701fa105724b1eb1f3daa99a8e0ee9a0abde1","_id":"compare-ver@2.0.0","_shasum":"10c085ab24d6cd3537250264c873b46554a48fe0","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"10c085ab24d6cd3537250264c873b46554a48fe0","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-2.0.0.tgz","integrity":"sha512-AzApMzU6IEHvJGFcaywBAzLVzsJXkNsGeWCiNoUuqElN0AvRKw65neNqo0WkpdBHQrKAFLmNSpqDFChObNR1+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBvX/h5KKVIjI+akk8tcIqMYSdhqrSpzqqMhs6e9z1RAiEAydPOu/CPc/1dpnCZ0nFvKrr2UuEtcOPGykFigFvbRO8="}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]},"2.0.1":{"name":"compare-ver","version":"2.0.1","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/test.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{},"gitHead":"de74148169e2e5de89f3c6045f02680873f0125c","_id":"compare-ver@2.0.1","_shasum":"237e9098283c9de6d1f4c8e67bbd7430459d75a0","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"237e9098283c9de6d1f4c8e67bbd7430459d75a0","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-2.0.1.tgz","integrity":"sha512-qsxdIBtsqgtC0qo+HdLFl1QAKHXooM6S2HifrlW6vSb1qCJE5vy5lz5QPX8oANu6z8QCgMgqHecFbkKDIQ6cpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID2fimf9xfTCScHHpB22KxUw8JxKhG6ImR04RGLLuZZrAiA0J+k5By/aMf3u6NSQV9Pslx1rrAOIZorrtEjPJUmthQ=="}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]},"2.0.2":{"name":"compare-ver","version":"2.0.2","description":"Compares two software version numbers (only number)","main":"index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"scripts":{"pretest":"npm install","test":"mocha tests/*.js"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"keywords":["compare","number","semver","version"],"devDependencies":{"karma":"^0.12.24","karma-chrome-launcher":"^0.1.5","karma-mocha":"^0.1.9","mocha":"^2.0.1","should":"^4.1.0"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"homepage":"https://github.com/lmtdit/compare-ver#readme","directories":{"test":"tests"},"dependencies":{},"gitHead":"de74148169e2e5de89f3c6045f02680873f0125c","_id":"compare-ver@2.0.2","_shasum":"8ecb8eb9dbf23ff2d87c56e74cbbb2cb7ffd9d7a","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.0.0","_npmUser":{"name":"lmtdit","email":"iampjg@gmail.com"},"dist":{"shasum":"8ecb8eb9dbf23ff2d87c56e74cbbb2cb7ffd9d7a","tarball":"https://registry.npmjs.org/compare-ver/-/compare-ver-2.0.2.tgz","integrity":"sha512-VeznF8KOp4C6rSg22tvnk8vgAveEMxVVgOVuCzqYIzGyzD2hQ4Zm/O5RKfOECcTqmn0BAAkyJKAN0eqkgUvsEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3e5RQdo4+D/RMm8gV9PXc7nN9mz2hXchCk5QZgZIkvwIgKf3vI6kN6MoR9zKTgf8LWtsQpGyCjKTSeGWVQ4Yg728="}]},"maintainers":[{"name":"lmtdit","email":"iampjg@gmail.com"}]}},"readme":"# compare-version\n\n> Compares two software version numbers (only number)\n\n-------\n\nThis code just uses Array.shift and recursive, which means that it can run in IE 6+.\n\n## Install\n\n```bash\n$ npm install --save compare-ver\n```\n\n\n## version rules\n\n```\n{num}.{num}. …… {num}.{num}\n```\n\n*e.g:*\n```\n\"1.7\" < \"1.7.1\" < \"1.7.10\" < \"1.7.10.01\" < \"1.7.0.10.010\"\n\"1.0\" < \"1.0.1\" < \"2.0\" < \"2.0.0.1\" < \"2.0.1\"\n\"1.0.0.0\" < \"1.0.1.0\" < \"2.0.0.0\" < \"2.0.0.1\" < \"2.0.1.0\"\n```\n\n## Usage\n\n### compareVer.gt(stringA,stringB)\nReturn number 1 0 -1 -2 -3 -100\n\n- if stringA  <  stringB then return -1\n- if stringA === stringB then return 0\n- if stringA  >  stringB then return 1\n- if input error value then return < -1\n\n### compareVer.lt(stringA,stringB)\nReturn number 1 0 -1 -2 -3 -100\n\n- if stringA  <  stringB then return 1\n- if stringA === stringB then return 0\n- if stringA  >  stringB then return -1\n- if input error value then return < -1\n\n```js\nvar compareVer = require('compare-ver');\n\n//gt\nconsole.log(compareVer.gt(\"0.0.2\",\"0.0.1\")); //1\nconsole.log(compareVer.gt(\"0.9.1\",\"0.9.1\")); //0\n\n//lt\nconsole.log(compareVer.lt(\"0.0.2\",\"0.0.1\")); //-1\nconsole.log(compareVer.lt(\"0.9.1\",\"0.9.1\")); //0\n\n//clean\nconsole.log(compareVer.clean(['1.1.b','1.0.1',12121])); //['1.0.1']\n\nvar arr = [\"1.7.0\",\"1.7\",\"1.ab.8\",\"1.70.0\",\"1.90\",\"1.9.0\",\"1.8\"];\ncompareVer.sort(arr); //->[\"1.7\",\"1.7.0\",\"1.8\",\"1.9.0\",\"1.70.0\",\"1.90\"]\ncompareVer.max(arr); //->\"1.90\"\ncompareVer.min(arr); //->\"1.7\"\n```\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) © [lmtdit](https://github.com/lmtdit)\n\n## End.\n","maintainers":[{"email":"iampjg@gmail.com","name":"lmtidt"}],"time":{"modified":"2022-06-13T19:41:59.329Z","created":"2016-01-24T11:09:13.329Z","0.0.2":"2016-01-24T11:09:13.329Z","1.0.0":"2016-01-24T19:34:25.845Z","1.0.1":"2016-01-25T05:22:41.063Z","1.0.2":"2016-01-25T05:24:04.897Z","2.0.0":"2016-01-25T17:38:24.505Z","2.0.1":"2016-01-25T17:46:41.049Z","2.0.2":"2016-01-25T17:49:17.992Z"},"homepage":"https://github.com/lmtdit/compare-ver#readme","keywords":["compare","number","semver","version"],"repository":{"type":"git","url":"git://github.com/lmtdit/compare-ver.git"},"author":{"name":"lmtdit","email":"lmtdit@gmail.com","url":"https://github.com/lmtdit"},"bugs":{"url":"https://github.com/lmtdit/compare-ver/issues"},"license":"MIT","readmeFilename":"README.md"}