1.0.2 • Published 8 years ago
npm-relative-version v1.0.2
npm-relative-version
Get relative version of the modules from npm.
Installation
npm install npm-relative-version
Usage
getRelativeVersion(pkg, options = { isLtr=true, type="patch" }) : Promise
Get a relative version string of pkg
.
var getRelativeVersion = require("npm-relative-version").getRelativeVersion;
// pkg.version is 1.0.1
var pkg = require("./package.json");
getRelativeVersion(pkg).then(version => {
// get -"patch" version
console.log(version);// 1.0.0
});
getVersionsAsync(pkg): string[]
Get versions array of pkg
Tests
npm test
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT