1.0.0 • Published 8 years ago
load-semver v1.0.0
load-semver
Load semver module from either CWD or npm CLI directory.
const loadSemver = require('load-semver');
(async () => {
const {parse} = await loadSemver();
const {major, minor, patch} = parse('1.25.48');
major; //=> 1
minor; //=> 25
patch; //=> 48
})();Installation
npm install load-semverAPI
const loadSemver = require('load-semver');loadSemver()
Return: Promise<Function>
Read the document of load-from-cwd-or-npm for the detailed loading algorithm.
License
ISC License © 2018 Shinnosuke Watanabe