Grunt was the first task runner to achieve critical mass, but there were a 
number of issues:

1. Grunt requires plug-ins for basic functionality such as file-watching
2. Grunt plug-ins often perform multiple tasks which made customization 
3. JSON configuration could become unwieldly for all but the most basic tasks.
4. Tasks could run slowly because Grunt saved files between every processing 

Many issues were addressed, but Gulp had already arrived and offered a number 
of improvements:

1. Features such as file watching were built-in.
2. Gulp plug-ins were mostly designed to do a single job.
3. Gulp uses JavaScript configuration code which was less verbose, easier to 
   read, simpler to modify.
4. Gulp was faster because it uses Node streams to pass data through a series 
   of piped plug-ins.  Files were only written at the end of the task.

Gulp itself is not perfect, and new task runners such as, and have also been competing for 
developer attention.  More recently, npm itself has been touted as a simpler 
option. All have their pros and cons.

What is Grunt?

Grunt is a JavaScript Task Runner. It is a server-side build tool.

How can we use Grunt?

npm install -g grunt-cli
npm install grunt --save-dev
npm install grunt-contrib-jshint --save-dev
module.exports = function(grunt) {

  // Project configuration.
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= %> <%="yyyy-mm-dd") %> */\n'
      build: {
        src: 'src/<%= %>.js',
        dest: 'build/<%= %>.min.js'

  // Load the plugin that provides the "uglify" task.

  // Default task(s).
  grunt.registerTask('default', ['uglify']);

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License