@lerna/has-npm-version
Test if the current version of npm satisfies a given semver range
Last updated 5 years ago by evocateur .
MIT · Repository · Bugs · Original npm
$ cnpm install @lerna/has-npm-version 
SYNC missed versions from official npm registry.

@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.

Current Tags

  • 6.0.3                                ...           latest (3 years ago)

5 Versions

  • 6.0.0-alpha.2                                ...           3 years ago
  • 6.0.3                                ...           3 years ago
  • 4.0.0                                ...           5 years ago
  • 3.14.2                                ...           6 years ago
  • 3.16.5                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org