get-ver
v1.2.1
Published
> Get available version on npmjs.com
Downloads
10
Readme
get-ver
Get available version on npmjs.com
Installation
npm install --save get-ver
Usage
get-ver(pakageName, [version])
version can be all types of semantic version. Check at semver
Return:
version
: requested version
pkg
: package.json for the version
var getVer = require('get-ver');
// Get latest version
getVer('semver')
.then(function (res) {
// do somgthing
})
.catch(function (res) {
// catch error
}
// Get in range 4.0.5 <= X < 5.0.0
getVer('semver', '^4.0.5')
.then(function (res) {
// do somgthing
})
.catch(function (res) {
// catch error
}
Created with
Yeoman and Generator-simple-package
License
MIT © NghiaTTran