npm-version-compare
Compare npm CLI version string with another version string
const npmVersionCompare = ; // When npm CLI v6.7.0 is installed async { await ; // 1 await ; // 0 await ; // -1};
Installation
npm install npm-version-compare
API
const npmVersionCompare = ;
npmVersionCompare(version)
version: string
(SemVer version expression)
Return: Promise<integer>
(-1
, 0
or 1
)
The resultant promise will be fulfilled with:
-1
if a given version is greater than the version of currently installednpm
0
if a given version is the same value as thenpm
version1
if thenpm
version is greater than a given version
Related project
- npm-cli-version — Get the currently installed npm version
License
ISC License © 2018 - 2019 Shinnosuke Watanabe