node-version-matches
Version:
Returns true if the current node version matches the given semver expression
33 lines (23 loc) • 1.19 kB
Markdown
[](https://www.npmjs.org/package/node-version-matches)
[](https://www.npmjs.org/package/node-version-matches)
[](https://travis-ci.org/75lb/node-version-matches)
[](https://coveralls.io/github/75lb/node-version-matches)
[](https://github.com/feross/standard)
# node-version-matches
Returns true if the current node version matches the given semver expression.
```js
import nodeVersionMatches from 'node-version-matches'
// assuming we're using node version 10
console.log(nodeVersionMatches('>=7.6.0'))
// true
console.log(nodeVersionMatches('<7.6.0'))
// false
// optional: pass in a specific node version as the second arg.
console.log(nodeVersionMatches('<7.6.0', 'v4.0.0'))
// true
```
```
$ npm install node-version-matches
```
* * *
© 2018-21 Lloyd Brookes \<75pound@gmail.com\>.