main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
919 bytes
|
Line | |
---|
1 | # at-least-node
|
---|
2 |
|
---|
3 | 
|
---|
4 | 
|
---|
5 | 
|
---|
6 |
|
---|
7 | Sometimes you need to check if you're on _at least_ a given Node.js version, but you don't want to pull in the whole [`semver`](https://www.npmjs.com/package/semver) kitchen sink. That's what `at-least-node` is for.
|
---|
8 |
|
---|
9 | | Package | Size |
|
---|
10 | | --------------- | ------- |
|
---|
11 | | `at-least-node` | 2.6 kB |
|
---|
12 | | `semver` | 75.5 kB |
|
---|
13 |
|
---|
14 | ```js
|
---|
15 | const atLeastNode = require('at-least-node')
|
---|
16 | atLeastNode('10.12.0')
|
---|
17 | // -> true on Node 10.12.0+, false on anything below that
|
---|
18 | ```
|
---|
19 |
|
---|
20 | When passing in a version string:
|
---|
21 |
|
---|
22 | - You cannot include a leading `v` (i.e. `v10.12.0`)
|
---|
23 | - You cannot omit sections (i.e. `10.12`)
|
---|
24 | - You cannot use pre-releases (i.e. `1.0.0-beta`)
|
---|
25 | - There is no input validation, if you make a mistake, the resulting behavior is undefined
|
---|
Note:
See
TracBrowser
for help on using the repository browser.