datasets.forEach(dataset => {
var parser = parse({delimiter: dataset.delimiter, ...);
// we can pass everything, fn, arrays, some extra data, ...
var transformer = transform(transformer_callback, dataset.defautls);
request(dataset.url).pipe(parser).pipe(transformer).pipe(process.stdout);
});
function transformer_callback(record, calllback, defaults) {
// we can use the third argument for each of the specific datasets.
record.country = defaults.country;
// e.g. for some dataset the default country is US, for another is EUR, ....
}
for example