May 25, 2021 Grunt
Only the most important methods are listed on this
page, and the complete EventEmitter2 API
grunt.event
object. T
he event namespace can use
.
.
(English period) is separated, and you can use namespace wildcards.
Note: Grunt doesn't issue any events at this time, but it's still useful in your own task.
Add a listener to the specified event and put the listener down at the end of the listener array.
grunt.event.on(event, listener)
Add a listener that executes once for the specified event. The secondary listener is called only after the event is triggered for the first time, and is removed after execution.
grunt.event.once(event, listener)
Add a listener to the specified event and execute n times before it is removed.
grunt.event.many(event, timesToListen, listener)
Remove all listeners that listen to a specified event from the listener array.
grunt.event.off(event, listener)
Remove all listeners, or all listeners for a specified event.
grunt.event.removeAllListeners([event])
Each listener that might listen to this event name is executed in turn, and the list of parameters is passed to each event listener.
grunt.event.emit(event, [arg1], [arg2], [...])