Skip to content
Nick Williams edited this page Feb 10, 2014 · 22 revisions

basic specification

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.

run(logger, config, input)

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.

Example

A minimally compliant module:

var when = require('when');
MyTask = {};
MyTask.run = function (logger, config) {
  return when(true);
};
module.exports = MyTask;
Clone this wiki locally