extruder
Functional, promise-based tools for processing node-task input objects.
API
extruder.map
Iterate over node-task inputs and map their sources for transformation by a provided callback. Return a promise which resolves to the modified input.
extruder
input
A node-task input object.fn
A method to be invoked for each source item. Its return value (can be a promise) will replace each source item.fn(source, dest)
context
The context thefn
will be called with.
var extruder = ;var sources = 'path/to/source1' 'path/to/source2';extruder; var sourceDestPairs = src: 'path/to/source1' dest: 'path/to/dest' src: 'path/to/source2' 'path/to/source3' dest: 'path/to/dest' ;extruder;
extruder.reduce
Iterate over node-task inputs and reduce their sources with a provided callback. Return a promise which resolves to the modified input.
extruder
input
A node-task input object.fn
A method to be invoked for each source array. Its return value (can be a promise) will replace each source array.fn(source, dest)
context
The context thefn
will be called with.
var extruder = ;var sources = 'path/to/source1' 'path/to/source2';extruder; var sourceDestPairs = src: 'path/to/source1' dest: 'path/to/dest' src: 'path/to/source2' 'path/to/source3' dest: 'path/to/dest' ;extruder;