-
Notifications
You must be signed in to change notification settings - Fork 2
Task
Nick Williams edited this page Feb 10, 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 be supplied as an array of Records.
A minimally compliant module:
var when = require('when');
MyTask = {};
MyTask.run = function (logger, config) {
return when(true);
};
module.exports = MyTask;