task
The canonical node-task generator.
Docs to follow when node-task spec is complete.
Usage
var Task = require('task');
var config = {
option: true,
flat: false
};
var input = [
{ src: ['input1', 'input1', 'input3'] }
];
var LogInputs = Task.extend({
name: 'loginputs',
description: 'log each source to console',
map: function (config, source) {
console.log(source);
return source;
}
});
var loginputs = new LogInputs();
loginputs.run(config, input);
var ConcatInputs = Task.extend({
name: 'concatinputs',
description: 'concat all sources',
reduce: function(config, sources, dest) {
return sources.join("+");
}
});
var concatinputs = new ConcatInputs();
concatinputs.run(config, input).then(function(result) {
console.log(result);
});