# nvm-guard

> Enforce correct .nvmrc version when running npm scripts

Latest version **1.0.4** (published 2019-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install nvm-guard
pnpm add nvm-guard
yarn add nvm-guard
bun add nvm-guard
```

Provides the command `nvm-guard`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-07-17 |
| First published | 2019-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 442.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Daniel Eckermann |
| Maintainers | ecrmnn |

## Links

- npm: https://www.npmjs.com/package/nvm-guard
- Repository: https://github.com/ecrmnn/nvm-guard
- Issues: https://github.com/ecrmnn/nvm-guard/issues
- npm.io page: https://npm.io/package/nvm-guard

## Dependencies (1)

- [compatible-version](https://npm.io/package/compatible-version.md) ^1.0.0

## Recent versions

- 1.0.4 (latest) — 2019-07-17
- 1.0.3 — 2019-07-11
- 1.0.2 — 2019-07-11
- 1.0.1 — 2019-07-11
- 1.0.0 — 2019-07-11
- 0.0.8 — 2019-07-11
- 0.0.7 — 2019-07-11
- 0.0.6 — 2019-07-11
- 0.0.5 — 2019-07-11
- 0.0.4 — 2019-07-11
- 0.0.3 — 2019-07-11
- 0.0.2 — 2019-07-11
- 0.0.1 — 2019-07-11

## README

# nvm-guard
> Enforce correct .nvmrc version when running npm scripts

[![npm version](https://img.shields.io/npm/v/nvm-guard.svg?style=flat-square)](http://badge.fury.io/js/nvm-guard)
[![npm downloads](https://img.shields.io/npm/dm/nvm-guard.svg?style=flat-square)](http://badge.fury.io/js/nvm-guard)
[![npm license](https://img.shields.io/npm/l/nvm-guard.svg?style=flat-square)](http://badge.fury.io/js/nvm-guard)
[![eslint](https://img.shields.io/badge/code_style-airbnb-blue.svg?style=flat-square)](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.

<img src="https://raw.githubusercontent.com/ecrmnn/nvm-guard/master/example.gif" width="100%" alt="nvm-guard">

### 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)

---
_Source: https://npm.io/package/nvm-guard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
