https://github.com/75lb/node-version-matches
Returns true if the current node version matches the given semver expression.
https://github.com/75lb/node-version-matches
Last synced: about 1 year ago
JSON representation
Returns true if the current node version matches the given semver expression.
- Host: GitHub
- URL: https://github.com/75lb/node-version-matches
- Owner: 75lb
- License: mit
- Created: 2018-06-27T16:32:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-19T09:17:48.000Z (about 5 years ago)
- Last Synced: 2025-02-02T08:31:56.603Z (over 1 year ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](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\>.