Reminder: This API isn't the recommended pattern anymore - export your tasks.
Defines a task within the task system. The task can then be accessed from the command line and the
Register a named function as a task:
Register an anonymous function as a task:
Retrieve a task that has been registered previously:
taskName is not provided, the task will be referenced by the
name property of a named function or a user-defined
displayName property. The
taskName parameter must be used for anonymous functions missing a
Since any registered task can be run from the command line, avoid using spaces in task names.
|taskName||string||An alias for the task function within the task system. Not needed when using named functions for |
|function||A task function or composed task - generated by |
When registering a task, nothing is returned.
When retrieving a task, a wrapped task (not the original function) registered as
taskName will be returned. The wrapped task has an
unwrap() method that will return the original function.
When registering a task where
taskName is missing and
taskFunction is anonymous, will throw an error with the message, "Task name must be specified".
|name||string||A special property of named functions. Used to register the task.|
|displayName||string||When attached to a |
|description||string||When attached to a |
|flags||object||When attached to a |