Saturday, June 29, 2013

Grunt - Getting Started

Purpose


To provide a brief overview of Grunt.  Along with some examples and addons to get started.

About Grunt


Grunt(http://gruntjs.com) is a task based automation tool for NodeJs.  Grunt needs to be part of any NodeJs developers tool belt.

Getting Started


Here are the installs to get going:


What Just Got Installed

  • grunt-cli - this is the command line interface that allows you to use grunt in a command window
  • grunt - this is the core library
  • grunt-contrib-jshint - this is an add-on that does linting, warnings/errors for invalid javascript.
  • grunt-contrib-watch - will spin up a task that does file watching.  This allows you to potentially do linting or testing after every file change
  • grunt-release - this will bumpup your NPM package version, git tag the release, commit to github, and then push to NPM.  Everything you need to release

Now what


Add the Grunt configuration file gruntfile.js. 



Finally 


ensure the added dev dependencies are in your package.json.




References