Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 23-May-2020 | - | ||||
LICENSE | H A D | 26-Oct-1985 | 770 | 7 | 4 | |
README.md | H A D | 26-Oct-1985 | 919 | 26 | 19 | |
package.json | H A D | 23-May-2020 | 1.5 KiB | 61 | 60 |
README.md
1# at-least-node 2 3![npm](https://img.shields.io/npm/v/at-least-node) 4![node](https://img.shields.io/node/v/at-least-node) 5![NPM](https://img.shields.io/npm/l/at-least-node) 6 7Sometimes 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 15const atLeastNode = require('at-least-node') 16atLeastNode('10.12.0') 17// -> true on Node 10.12.0+, false on anything below that 18``` 19 20When 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 26