Skip to content
Newer
Older
100644 341 lines (233 sloc) 14.6 KB
7ee61b6 @cowboy Docs reorganization.
authored Feb 4, 2012
1 [Grunt homepage](https://github.com/cowboy/grunt) | [Documentation table of contents](toc.md)
2
3 # The grunt API
4
82a6799 @cowboy More docs.
authored Mar 19, 2012
5 Grunt exposes all of its methods and properties on the `grunt` object that gets passed into the `exports.config` function exported in your [grunt.js gruntfile](configuring.md) or the `exports.tasks` function exported in your [tasks file](tasks_creating.md).
dbaee9c @cowboy More docs.
authored Mar 19, 2012
6
82a6799 @cowboy More docs.
authored Mar 19, 2012
7 For example, your project's [grunt.js gruntfile](configuring.md) might look like this:
dbaee9c @cowboy More docs.
authored Mar 19, 2012
8
9 ```javascript
10 exports.config = function(grunt) {
ee1939e @cowboy More docs.
authored Mar 19, 2012
11
12 // Project configuration.
13 grunt.initConfig({
14 lint: {
15 all: ['grunt.js', 'lib/**/*.js''test/**/*.js']
16 },
17 jshint: {
18 options: {
19 browser: true
20 }
21 }
22 });
23
b2a86d8 @cowboy More docs.
authored Mar 19, 2012
24 // Load tasks from "grunt-sample" grunt plugin installed via Npm.
ee1939e @cowboy More docs.
authored Mar 19, 2012
25 grunt.loadNpmTasks('grunt-sample');
26
27 // Default task.
28 grunt.registerTask('default', 'lint sample');
29
dbaee9c @cowboy More docs.
authored Mar 19, 2012
30 };
31 ```
32
c8e22b4 @cowboy More docs.
authored Mar 19, 2012
33 And if you're creating a [grunt plugin](plugins.md) or just organizing tasks into a folder, a [custom tasks file](tasks_creating.md) might look like this:
dbaee9c @cowboy More docs.
authored Mar 19, 2012
34
35 ```javascript
36 exports.tasks = function(grunt) {
ee1939e @cowboy More docs.
authored Mar 19, 2012
37
38 // Create a new task.
39 grunt.registerTask('awesome', 'Print out "awesome!!!"', function() {
40 var awesome = grunt.helper('awesome');
41 log.write(awesome);
42 });
43
44 // Register a helper.
45 grunt.registerHelper('awesome', function() {
46 return 'awesome!!!';
47 });
48
dbaee9c @cowboy More docs.
authored Mar 19, 2012
49 };
50 ```
51
16c967b @cowboy More docs.
authored Mar 19, 2012
52 But these are just examples. For more information, take a look at the API documentation:
5b73737 @cowboy More docs.
authored Mar 19, 2012
53
48bcd44 @cowboy More docs.
authored Mar 19, 2012
54 ## Config
d7920ea @cowboy More docs.
authored Mar 20, 2012
55 _Note that the method listed below is also available on the [grunt.config](api_config.md) object in addition to the `grunt` object._
2b76fd5 @cowboy More docs.
authored Mar 20, 2012
56
80581c2 @cowboy More docs.
authored Mar 19, 2012
57
48bcd44 @cowboy More docs.
authored Mar 19, 2012
58 ### grunt.initConfig
82a6799 @cowboy More docs.
authored Mar 19, 2012
59 Initialize a configuration object for the current project. The specified `configObject` is used by tasks and helpers and can also be accessed using the [grunt.config](api_config.md) method. Nearly every project's [grunt.js gruntfile](configuring.md) will call this method.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
60
61 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
62 grunt.initConfig(configObject)
63 ```
64
31950dd @cowboy More docs.
authored Mar 19, 2012
65 This example contains sample config data for the [lint task](task_lint.md):
34274e3 @cowboy More docs.
authored Mar 19, 2012
66
67 ```javascript
68 grunt.initConfig({
69 lint: {
70 all: ['lib/*.js', 'test/*.js', 'grunt.js']
71 }
72 });
dbaee9c @cowboy More docs.
authored Mar 19, 2012
73 ```
74
5a41466 @cowboy More docs.
authored Mar 19, 2012
75 See the [configuring grunt](configuring.md) page for more configuration examples.
29b12b9 @cowboy More docs.
authored Mar 19, 2012
76
fbc0986 @cowboy More docs.
authored Mar 19, 2012
77 _This method is an alias for the [config.init](api_config.md) method._
dbaee9c @cowboy More docs.
authored Mar 19, 2012
78
48bcd44 @cowboy More docs.
authored Mar 19, 2012
79
0e2160e @cowboy More docs.
authored Mar 19, 2012
80 ## Creating Tasks
8e1ae74 @cowboy More docs.
authored Mar 20, 2012
81 Tasks are grunt's bread and butter. The stuff you do most often, like `lint` or `test`. Every time grunt is run, you specify one more more tasks to run, which tells grunt what you'd like it to do.
82
83 If you don't specify a task, but a task named "default" has been defined, that task will run (unsurprisingly) by default.
84
d7920ea @cowboy More docs.
authored Mar 20, 2012
85 _Note that the methods listed below are also available on the [grunt.task](api_task.md) object in addition to the `grunt` object._
86
80581c2 @cowboy More docs.
authored Mar 19, 2012
87
48bcd44 @cowboy More docs.
authored Mar 19, 2012
88 ### grunt.registerTask
e2bebb6 @cowboy More docs.
authored Mar 19, 2012
89 Register an "alias task" or a task function. This method supports the following two signatures:
dbaee9c @cowboy More docs.
authored Mar 19, 2012
90
cc08918 @cowboy More docs.
authored Mar 19, 2012
91 **Alias task**
5c46902 @cowboy More docs.
authored Mar 19, 2012
92
f353857 @cowboy More docs.
authored Mar 20, 2012
93 If a task list is specified, the new task will be an alias for one or more other tasks. Whenever this "alias task" is run, every specified task in `taskList` will be run, in the order specified. The `taskList` argument can be a space-separated string or an array of task names.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
94
95 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
96 grunt.registerTask(taskName, taskList)
f531113 @cowboy More docs.
authored Mar 19, 2012
97 ```
98
e2bebb6 @cowboy More docs.
authored Mar 19, 2012
99 This example alias task defines a "default" task whereby the "lint", "qunit", "concat" and "min" tasks are run automatically if grunt is executed without any tasks specified:
100
101 ```javascript
102 task.registerTask('default', 'lint qunit concat min');
103 ```
104
cc08918 @cowboy More docs.
authored Mar 19, 2012
105 **Function task**
5c46902 @cowboy More docs.
authored Mar 19, 2012
106
f683ef9 @cowboy More docs.
authored Mar 20, 2012
107 If a `description` and `taskFunction` are passed, the specified function will be executed whenever the task is run. In addition, the specified description will be shown when `grunt --help` is run. Task-specific properties and methods are available inside the task function as properties of the `this` object. The task function can return `false` to indicate that the task has failed.
80581c2 @cowboy More docs.
authored Mar 19, 2012
108
109 Note that the `grunt.registerMultiTask` method, explained below, can be used to define a special type of task known as a "multi task."
f531113 @cowboy More docs.
authored Mar 19, 2012
110
111 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
112 grunt.registerTask(taskName, description, taskFunction)
dbaee9c @cowboy More docs.
authored Mar 19, 2012
113 ```
114
451428f @cowboy More docs.
authored Mar 19, 2012
115 This example task logs `foo, testing 123` if grunt is run via `grunt foo:testing:123`. If the task is run without arguments as `grunt foo` the task logs `foo, no args`.
5dacc94 @cowboy More docs.
authored Mar 19, 2012
116
117 ```javascript
118 grunt.registerTask('foo', 'A sample task that logs stuff.', function(arg1, arg2) {
119 if (arguments.length === 0) {
120 grunt.log.writeln(this.name + ", no args");
121 } else {
122 grunt.log.writeln(this.name + ", " + arg1 + " " + arg2);
123 }
124 });
125 ```
126
82a6799 @cowboy More docs.
authored Mar 19, 2012
127 See the [creating tasks](tasks_creating.md) documentation for more examples of tasks and alias tasks.
f531113 @cowboy More docs.
authored Mar 19, 2012
128
78099bb @cowboy More docs.
authored Mar 20, 2012
129 _This method is an alias for the [grunt.task.registerTask](api_task.md) method._
f531113 @cowboy More docs.
authored Mar 19, 2012
130
131
48bcd44 @cowboy More docs.
authored Mar 19, 2012
132 ### grunt.registerMultiTask
451428f @cowboy More docs.
authored Mar 19, 2012
133 Register a "multi task." A multi task is a task that implicitly iterates over all of its named sub-properties (AKA targets) if no target was specified. In addition to the default properties and methods, extra multi task-specific properties are available inside the task function as properties of the `this` object.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
134
31950dd @cowboy More docs.
authored Mar 19, 2012
135 Many of the built-in tasks, including the [lint task](task_lint.md), [concat task](task_concat.md) and [min task](task_min.md) are multi tasks.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
136
137 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
138 grunt.registerMultiTask(taskName, description, taskFunction)
dbaee9c @cowboy More docs.
authored Mar 19, 2012
139 ```
140
82a6799 @cowboy More docs.
authored Mar 19, 2012
141 Given the specified configuration, this example multi task would log `foo: 1,2,3` if grunt was run via `grunt log:foo`, or it would log `bar: hello world` if grunt was run via `grunt log:bar`. If grunt was run as `grunt log` however, it would log `foo: 1,2,3` then `bar: hello world` then `grunt baz: false`.
451428f @cowboy More docs.
authored Mar 19, 2012
142
143 ```javascript
144 grunt.initConfig({
145 log: {
146 foo: [1, 2, 3],
147 bar: 'hello world',
148 baz: false
149 }
150 });
151
152 grunt.registerMultiTask('log', 'Log stuff.', function(target) {
153 grunt.log.writeln(target + ': ' + this.data);
154 });
155 ```
156
82a6799 @cowboy More docs.
authored Mar 19, 2012
157 See the [creating tasks](tasks_creating.md) documentation for more examples of multi tasks.
80581c2 @cowboy More docs.
authored Mar 19, 2012
158
78099bb @cowboy More docs.
authored Mar 20, 2012
159 _This method is an alias for the [grunt.task.registerMultiTask](api_task.md) method._
80581c2 @cowboy More docs.
authored Mar 19, 2012
160
161
48bcd44 @cowboy More docs.
authored Mar 19, 2012
162 ### grunt.registerInitTask
fd45238 @cowboy More docs.
authored Mar 19, 2012
163 Register an "init task." An init task is a task that doesn't require any configuration data, and as such will still run even if grunt can't find a [grunt.js gruntfile](configuring.md). The [init task](task_init.md) is an example of an init task.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
164
165 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
166 grunt.registerInitTask(taskName, description, taskFunction)
dbaee9c @cowboy More docs.
authored Mar 19, 2012
167 ```
168
fd45238 @cowboy More docs.
authored Mar 19, 2012
169 For an init task example, see the [init task source](../tasks/init.js).
82a6799 @cowboy More docs.
authored Mar 19, 2012
170
78099bb @cowboy More docs.
authored Mar 20, 2012
171 _This method is an alias for the [grunt.task.registerInitTask](api_task.md) method._
5be5bf3 @cowboy More docs.
authored Mar 19, 2012
172
78099bb @cowboy More docs.
authored Mar 20, 2012
173 ### grunt.renameTask
174 Rename a task. This might be useful if you want to override the default behavior of a task, while retaining the old name.
175
176 ```javascript
177 grunt.renameTask(oldname, newname)
178 ```
179
180 _This method is an alias for the [grunt.task.renameTask](api_task.md) method._
5be5bf3 @cowboy More docs.
authored Mar 19, 2012
181
18e3d03 @cowboy More docs.
authored Mar 19, 2012
182 ## Inside Tasks
2622f7b @cowboy More docs.
authored Mar 20, 2012
183 An object is made available as `this` inside each task function that contains a number of useful task-specific properties and methods. This same object is also exposed as `grunt.task.current` for use in [templates](api_template.md).
29a06f8 @cowboy More docs.
authored Mar 20, 2012
184
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
185 ### this.async / grunt.task.current.async
62a16c0 @cowboy More docs.
authored Mar 19, 2012
186 If a task is asynchronous, this method must be invoked to instruct grunt to wait. It returns a handle to a "done" function that should be called when the task has completed. `false` can be passed to the done function to indicate that the task has failed. If this method isn't invoked, the task executes synchronously.
148d6ee @cowboy More docs.
authored Mar 19, 2012
187
188 ```javascript
189 // Tell grunt this task is asynchronous.
190 var done = this.async();
191 // Your async code.
192 setTimeout(function() {
d5405a4 @cowboy More docs.
authored Mar 19, 2012
193 // Let's simulate an error, sometimes.
36cf507 @cowboy More docs.
authored Mar 19, 2012
194 var success = Math.random() > 0.5;
62a16c0 @cowboy More docs.
authored Mar 19, 2012
195 // All done!
36cf507 @cowboy More docs.
authored Mar 19, 2012
196 done(success);
148d6ee @cowboy More docs.
authored Mar 19, 2012
197 }, 1000);
198 ```
5be5bf3 @cowboy More docs.
authored Mar 19, 2012
199
f353857 @cowboy More docs.
authored Mar 20, 2012
200 ### this.requires / grunt.task.current.requires
201 If one task depends on the successful completion of another task (or tasks), this method can be used to force grunt to abort if the other task didn't run, or if the other task failed. The task list can be a space-separated string, an array of task names, or individual task name arguments.
202
a167b63 @cowboy More docs.
authored Mar 20, 2012
203 Note that this won't actually run the specified task(s), it will just fail the current task if they haven't already run successfully.
46c8f4a @cowboy More docs.
authored Mar 20, 2012
204
f353857 @cowboy More docs.
authored Mar 20, 2012
205 ```javascript
206 this.requires(taskList)
207 ```
208
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
209 ### this.name / grunt.task.current.name
3ee8516 @cowboy More docs.
authored Mar 19, 2012
210 The name of the task, as defined in `grunt.registerTask`. For example, if a "sample" task was run as `grunt sample` or `grunt sample:foo`, inside the task function, `this.name` would be `"sample"`.
6a891d1 @cowboy More docs.
authored Mar 19, 2012
211
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
212 ### this.nameArgs / grunt.task.current.nameArgs
3ee8516 @cowboy More docs.
authored Mar 19, 2012
213 The name of the task, as specified with any colon-separated arguments or flags on the command-line. For example, if a "sample" task was run as `grunt sample:foo`, inside the task function, `this.nameArgs` would be `"sample:foo"`.
6a891d1 @cowboy More docs.
authored Mar 19, 2012
214
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
215 ### this.args / grunt.task.current.args
3ee8516 @cowboy More docs.
authored Mar 19, 2012
216 An array of arguments passed to the task. For example, if a "sample" task was run as `grunt sample:foo:bar`, inside the task function, `this.args` would be `["foo", "bar"]`. Note that in multi tasks, the target is removed from the `this.args` array and is not passed into the task function.
148d6ee @cowboy More docs.
authored Mar 19, 2012
217
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
218 ### this.flags / grunt.task.current.flags
3ee8516 @cowboy More docs.
authored Mar 19, 2012
219 An object generated from the arguments passed to the task. For example, if a "sample" task was run as `grunt sample:foo:bar`, inside the task function, `this.flags` would be `{foo: true, bar: true}`. In a multi task, the target name is not set as a flag.
220
f353857 @cowboy More docs.
authored Mar 20, 2012
221 ### this.errorCount / grunt.task.current.errorCount
222 The number of [log.error](api_log.md) calls that occurred during this task. This can be used to fail a task if errors occurred during the task.
223
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
224 ### this.extraspaths / grunt.task.current.extraspaths
18e3d03 @cowboy More docs.
authored Mar 19, 2012
225 TODO: re-evaluate
3ee8516 @cowboy More docs.
authored Mar 19, 2012
226
227
228 ## Inside Multi Tasks
229
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
230 ### this.target / grunt.task.current.target
3ee8516 @cowboy More docs.
authored Mar 19, 2012
231 In a multi task, this is the name of the target currently being iterated over. For example, if a "sample" multi task was run as `grunt sample:foo` with the config data `{sample: {foo: "bar"}}`, inside the task function, `this.target` would be `"foo"`.
148d6ee @cowboy More docs.
authored Mar 19, 2012
232
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
233 ### this.data / grunt.task.current.data
3ee8516 @cowboy More docs.
authored Mar 19, 2012
234 In a multi task, this is the actual data stored in the grunt config object for the given target. For example, if a "sample" multi task was run as `grunt sample:foo` with the config data `{sample: {foo: "bar"}}`, inside the task function, `this.data` would be `"bar"`.
148d6ee @cowboy More docs.
authored Mar 19, 2012
235
7e13cf4 @cowboy More docs.
authored Mar 20, 2012
236 ### this.file / grunt.task.current.file
48a8956 @cowboy More docs.
authored Mar 19, 2012
237 In a multi task, target data can be stored in two different formats. A relatively basic "compact" format and a much more flexible "full" format. When the compact format is used, that key and value are made available as `this.file.dest` and `this.file.src`, respectively. When the full format is used, the specified `src` and `dest` values are used for `this.file.dest` and `this.file.src`.
148d6ee @cowboy More docs.
authored Mar 19, 2012
238
5870cd6 @cowboy More docs.
authored Mar 19, 2012
239 Note that while grunt supports expanding [templates](api_template.md) for both `src` and `dest`, they only work for the `dest` file path when the _full_ format is used.
6a891d1 @cowboy More docs.
authored Mar 19, 2012
240
18e3d03 @cowboy More docs.
authored Mar 19, 2012
241 ```javascript
242 grunt.initConfig({
243 concat: {
244 // This is the "compact" format.
245 'dist/built.js': ['src/file1.js', 'src/file2.js'],
246 // This is the "full" format.
247 built: {
248 src: ['src/file1.js', 'src/file2.js'],
249 dest: 'dist/built.js'
250 }
251 }
252 });
253 ```
5be5bf3 @cowboy More docs.
authored Mar 19, 2012
254
255
0e2160e @cowboy More docs.
authored Mar 19, 2012
256 ## Loading Externally-Defined Tasks
6d9005d @cowboy More docs.
authored Mar 20, 2012
257 For most projects, tasks and helpers will be defined in the [grunt.js gruntfile](configuring.md). For larger projects, or in cases where tasks and helpers need to be shared across projects, tasks can be loaded from one or more external directories or Npm-installed grunt plugins.
258
89ccb3e @cowboy More docs.
authored Mar 20, 2012
259 _Note that the methods listed below are also available on the [grunt.task](api_task.md) object in addition to the `grunt` object._
5be5bf3 @cowboy More docs.
authored Mar 19, 2012
260
48bcd44 @cowboy More docs.
authored Mar 19, 2012
261 ### grunt.loadTasks
b744b4e @cowboy More docs.
authored Mar 19, 2012
262 Load task-related files from the specified directory, relative to the [grunt.js gruntfile](configuring.md). This method can be used to load task-related files from a local grunt plugin by specifying the path to that plugin's "tasks" subdirectory.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
263
264 ```javascript
cb7a64a @cowboy More docs.
authored Mar 19, 2012
265 grunt.loadTasks(tasksPath)
dbaee9c @cowboy More docs.
authored Mar 19, 2012
266 ```
267
78099bb @cowboy More docs.
authored Mar 20, 2012
268 _This method is an alias for the [grunt.task.loadTasks](api_task.md) method._
dbaee9c @cowboy More docs.
authored Mar 19, 2012
269
cb7a64a @cowboy More docs.
authored Mar 19, 2012
270
271 ### grunt.loadNpmTasks
e03cb7a @cowboy More docs.
authored Mar 19, 2012
272 Load tasks and helpers from the specified Npm-installed grunt plugin. If the verion of grunt being run was installed globally via Npm, this will load a global Npm module. If the verion of grunt being run was installed locally via Npm, this will load a local Npm module.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
273
bfd4630 @cowboy More docs.
authored Mar 20, 2012
274 A grunt plugin is really just a folder containing a `package.json`, a `tasks` directory, and a few other files. You can very easily create a grunt plugin by using the [init task](task_init.md).
19675e0 @cowboy More docs.
authored Mar 20, 2012
275
dbaee9c @cowboy More docs.
authored Mar 19, 2012
276 ```javascript
cb7a64a @cowboy More docs.
authored Mar 19, 2012
277 grunt.loadNpmTasks(pluginName)
dbaee9c @cowboy More docs.
authored Mar 19, 2012
278 ```
279
78099bb @cowboy More docs.
authored Mar 20, 2012
280 _This method is an alias for the [grunt.task.loadNpmTasks](api_task.md) method._
cb7a64a @cowboy More docs.
authored Mar 19, 2012
281
282
0e2160e @cowboy More docs.
authored Mar 19, 2012
283 ## Defining and Executing Helpers
89ccb3e @cowboy More docs.
authored Mar 20, 2012
284 _Note that the methods listed below are also available on the [grunt.task](api_task.md) object in addition to the `grunt` object._
dbaee9c @cowboy More docs.
authored Mar 19, 2012
285
48bcd44 @cowboy More docs.
authored Mar 19, 2012
286 ### grunt.registerHelper
2e59c05 @cowboy More docs.
authored Mar 20, 2012
287 Register a helper function that can be used by any task. When called as a directive, `this.directive` will be true inside of the helper.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
288
289 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
290 grunt.registerHelper(helperName, helperFunction)
dbaee9c @cowboy More docs.
authored Mar 19, 2012
291 ```
292
b744b4e @cowboy More docs.
authored Mar 19, 2012
293 In this example helper, the numbers `1` and `2` are passed in and the value `3` is returned.
294
295 ```javascript
296 grunt.registerHelper("add_two_nums", function(a, b) {
297 return a + b;
298 });
299 ```
300
78099bb @cowboy More docs.
authored Mar 20, 2012
301 _This method is an alias for the [grunt.task.registerHelper](api_task.md) method._
302
303 ### grunt.renameHelper
304 Rename a helper. This might be useful if you want to override the default behavior of a helper, while retaining the old name (to avoid having to completely recreate an already-made task just because you needed to override or extend a built-in helper).
305
306 ```javascript
307 grunt.renameHelper(oldname, newname)
308 ```
b744b4e @cowboy More docs.
authored Mar 19, 2012
309
78099bb @cowboy More docs.
authored Mar 20, 2012
310 _This method is an alias for the [grunt.task.renameHelper](api_task.md) method._
dbaee9c @cowboy More docs.
authored Mar 19, 2012
311
b744b4e @cowboy More docs.
authored Mar 19, 2012
312 ### grunt.helper
313 Invoke a registered helper function.
dbaee9c @cowboy More docs.
authored Mar 19, 2012
314
315 ```javascript
34274e3 @cowboy More docs.
authored Mar 19, 2012
316 grunt.helper(helperName [, arguments...])
dbaee9c @cowboy More docs.
authored Mar 19, 2012
317 ```
7ee61b6 @cowboy Docs reorganization.
authored Feb 4, 2012
318
b744b4e @cowboy More docs.
authored Mar 19, 2012
319 In this example, the previously defined `add_two_nums` helper is invoked.
b260167 @cowboy More docs.
authored Mar 19, 2012
320
b744b4e @cowboy More docs.
authored Mar 19, 2012
321 ```javascript
322 grunt.helper("add_two_nums", 1, 2) // 3
323 ```
b260167 @cowboy More docs.
authored Mar 19, 2012
324
78099bb @cowboy More docs.
authored Mar 20, 2012
325 _This method is an alias for the [grunt.task.helper](api_task.md) method._
b260167 @cowboy More docs.
authored Mar 19, 2012
326
327
7ee61b6 @cowboy Docs reorganization.
authored Feb 4, 2012
328 ## Internals
329
6f02aa2 @cowboy More docs.
authored Mar 19, 2012
330 * [grunt.utils](api_utils.md) - Miscellaneous utilities, including Underscore.js, Async and Hooker.
51393d8 @cowboy More docs.
authored Mar 20, 2012
331 * [grunt.template](api_template.md) - Underscore.js template processing and other template-related methods.
f7c2f50 @cowboy More docs.
authored Mar 20, 2012
332 * [grunt.task](api_task.md) - Register and run tasks and helpers, load external tasks.
62a362f @cowboy More docs.
authored Mar 19, 2012
333 * [grunt.file](api_file.md) - Glob expansion, file reading, writing, directory traversing.
334 * [grunt.fail](api_fail.md) - More serious than error logging, `fail.warn` and `fail.fatal` will halt everything
335 * [grunt.config](api_config.md) - Reading values from the grunt configuration.
336 * [grunt.option](api_option.md) - Reading values from the command-line options.
337 * [grunt.log](api_log.md) - Don't use `console.log`, use `log.writeln` instead!
338 * [grunt.verbose](api_verbose.md) - Just like `log`, but only logs if `--verbose` was specified.
7ee61b6 @cowboy Docs reorganization.
authored Feb 4, 2012
339
340 Unfortunately, I haven't documented everything yet. Fortunately, the source is open and browsable. Have fun!
Something went wrong with that request. Please try again.