https://github.com/ecrmnn/nvm-guard
💂♂️ Enforce correct .nvmrc version when running npm scripts
https://github.com/ecrmnn/nvm-guard
Last synced: 2 months ago
JSON representation
💂♂️ Enforce correct .nvmrc version when running npm scripts
- Host: GitHub
- URL: https://github.com/ecrmnn/nvm-guard
- Owner: ecrmnn
- License: mit
- Created: 2019-07-11T11:05:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-17T07:33:22.000Z (almost 6 years ago)
- Last Synced: 2025-04-02T15:51:19.712Z (3 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/nvm-guard
- Size: 1.46 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# nvm-guard
> Enforce correct .nvmrc version when running npm scripts[](http://badge.fury.io/js/nvm-guard)
[](http://badge.fury.io/js/nvm-guard)
[](http://badge.fury.io/js/nvm-guard)
[](https://github.com/airbnb/javascript)### Installation
```bash
npm install nvm-guard --save-dev
```### Why?
`nvm-guard` protects your npm scripts for being ran with wrong Node.js version.
Make sure that all contributors are using the specified version and avoid unnecessary dependency hassle.
### Usage
In your `package.json` add `nvm-guard` as a pre-hook or before the scripts you want to protect.
```javascript
{
"scripts": {
// When running npm run eslint, we'll first call nvm-guard, then ESLint if nvm-guard passes
"eslint": "nvm-guard && eslint src/",// Will be called before npm test
// npm docs: https://docs.npmjs.com/misc/scripts
"pretest": "nvm-guard",
}
}
```### Related
- [compatible-version](https://github.com/ecrmnn/compatible-version) - API for this module### License
MIT © [Daniel Eckermann](http://danieleckermann.com)