Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@lerna/has-npm-version

3.13.0 • Public • Published

@lerna/has-npm-version

Test if the current version of npm satisfies a given semver range

Usage

const hasNpmVersion = require("@lerna/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.

Keywords

install

npm i @lerna/has-npm-version

Downloadsweekly downloads

435,065

version

3.13.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability