grunt
Grunt exposes all of its methods and properties on the grunt
object that gets passed into the module.exports
function exported in your Gruntfile, Grunt plugin or in a tasks file.
Nearly all of the following methods are defined elsewhere, but are provided directly on the grunt
object for convenience. See the individual api section docs for detailed explanations and examples.
Config
grunt.initConfig
This method is an alias for the grunt.config.init method.
Creating Tasks
grunt.registerTask
This method is an alias for the grunt.task.registerTask method.
grunt.registerMultiTask
This method is an alias for the grunt.task.registerMultiTask method.
grunt.renameTask
This method is an alias for the grunt.task.renameTask method.
Loading Externally-Defined Tasks
grunt.loadTasks
This method is an alias for the grunt.task.loadTasks method.
grunt.loadNpmTasks
This method is an alias for the grunt.task.loadNpmTasks method.
Warnings and Fatal Errors
grunt.warn
This method is an alias for the grunt.fail.warn method.
grunt.fatal
This method is an alias for the grunt.fail.fatal method.
Command-line Options
grunt.option
Retrieve the value of a command-line option, eg. debug
. Note that for each command-line option, the inverse can be tested, eg. no-debug
.
grunt.option(optionName)
Miscellaneous
grunt.package
The current Grunt package.json
metadata, as an object.
grunt.package
grunt.version
The current Grunt version, as a string. This is just a shortcut to the grunt.package.version
property.
grunt.version