-
Notifications
You must be signed in to change notification settings - Fork 2
Task
Tyler Kellen edited this page Jan 15, 2014
·
22 revisions
Perform an arbitrary task.
A valid node-task module is any object with a run
property whose value is a method with the following signature: run(logger, config, input)
. The run
method must return a promise which resolves when the task has completed. If a task fails it must reject the promise. All other properties listed below are optional.
Execute a task, returning a promise representing its completion. Logger should be an object presenting a valid Logging API. Config should be an object holding the task configuration. If a task has file input, it must arrive in a valid Input Format.
A minimal compliant module:
var when = require('when');
MyTask = {};
MyTask.run = function (logger, config) {
return when(true);
};
module.exports = Task;