@0x-lerna-fork/has-npm-version 中文文档教程
@0x-lerna-fork/has-npm-version
测试当前版本的 npm 是否满足给定的 semver 范围
Usage
const hasNpmVersion = require("@0x-lerna-fork/has-npm-version");
// `npm --version` === 6.3.0
hasNpmVersion(">=6"); // => true
// `npm --version` === 5.6.0
hasNpmVersion(">=6"); // => false
// makePredicate() caches the call to `npm --version`
// useful if you're calling it repeatedly in a loop
const predicate = hasNpmVersion.makePredicate();
// `npm --version` === 6.3.0
hasNpmVersion(">=5"); // => true
安装 lerna 以访问 lerna
命令行界面。
@0x-lerna-fork/has-npm-version
Test if the current version of npm satisfies a given semver range
Usage
const hasNpmVersion = require("@0x-lerna-fork/has-npm-version");
// `npm --version` === 6.3.0
hasNpmVersion(">=6"); // => true
// `npm --version` === 5.6.0
hasNpmVersion(">=6"); // => false
// makePredicate() caches the call to `npm --version`
// useful if you're calling it repeatedly in a loop
const predicate = hasNpmVersion.makePredicate();
// `npm --version` === 6.3.0
hasNpmVersion(">=5"); // => true
Install lerna for access to the lerna
CLI.