https://github.com/bitttttten/verify-nvmrc
Verifies that the loaded node version matches the closest found .nvmrc file.
https://github.com/bitttttten/verify-nvmrc
node nvmrc version-check version-checker versioning
Last synced: 5 months ago
JSON representation
Verifies that the loaded node version matches the closest found .nvmrc file.
- Host: GitHub
- URL: https://github.com/bitttttten/verify-nvmrc
- Owner: bitttttten
- Created: 2021-08-17T13:23:29.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T07:57:00.000Z (over 1 year ago)
- Last Synced: 2024-11-11T13:52:23.399Z (11 months ago)
- Topics: node, nvmrc, version-check, version-checker, versioning
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# verify-nvmrc
Script to help verify that the loaded node version matches what is set in the the closest .nvmrc file.
## Usage
You can run this script through `npx`.
```sh
npx verify-nvmrc
# Node version is correct
```## Options
- `-e, --emoji`
Supports emojis.
- `-v, --verbose`
Logs out where it found the nvmrc file, if one is present. And logs out current node version.
- `-f, --fail`
Process exits with code 1 if node version mismatch.
```sh
npx verify-nvmrc -e -v
# âšī¸ Current node version v14.15.4
# âšī¸ Found .nvmrc file with v14.15.4 at /Users/bitttttten/github.com/verify-nvmrc/.nvmrc
# Node version is correct đ
```## Caveats
Kind of ironically only supports node v12 and above since this script uses ES modules (for now, feel free to open a PR). To run with node v10, you should enable support for ES modules with the `--experimental-modules` flag: `npx verify-nvmrc --experimental-modules`. For node v8 and below, feel free to open a PR until a version of the script has been written that is v8 compatible.