grunt-node-version

A grunt task to ensure you are using the node version required by your project's package.json

grunt-node-version

A grunt task to ensure you are using the Node version required by your project's package.json

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-node-version --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-node-version');

In your project's Gruntfile, add a section named node_version to the data object passed into grunt.initConfig().

grunt.initConfig({
  node_version: {
    options: {
      errorLevel: 'fatal',
      extendExec: true,
      nvm: true,
      nvmPath: '~/.nvm/nvm.sh'
    }
  }
})

Type: String Default value: 'fatal'

The level of error given when the wrong Node version is being used. Accepted values are 'warn' and 'fatal'. Warn can can be overidden with --force, fatal cannot.

Type: Boolean Default value: true

A boolean that determines if grunt-node-version should extend grunt-exec.

Type: Boolean Default value: true

A boolean that determines whether to attempt to use/install a version of Node compatible with the project using NVM. If set to false, the plugin will just print an error if the wrong Node version is being used.

Type: String Default value: '~/.nvm/nvm.sh'

A string that represents the path to your NVM install.

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

0.1.0 First release