code: function getType(fileName) {
          var type = 'text';
          if (fileName.indexOf('.json') === fileName.length - 5) {
              type = 'json';
          } else if (fileName.indexOf('.yml') === fileName.length - 4) {
              type = 'yml';
          }
          return type;
      }
docs: Please see the Grunt documentation for more information regarding task creation: http://gruntjs.com/creating-tasks