Closed kenzik closed 3 years ago
Should we expect the step function in the CSVParse() options to pass the result down the chain?
step
const { StringStream } = require('scramjet'); const fs = require('fs'); const args = process.argv.slice(2); // seq.csv // // line // 002 // 003 // 004 // 005 const opts = { header: true, delimiter: ',' } if(args[0]==='step') { opts['step'] = (results, parser) => { return results }; } if(args[0]==='step-worker') { opts['step'] = (results, parser) => { return results }; opts['worker'] = true; } console.log('Running with opts: ', opts); StringStream .from(fs.createReadStream('./seq.csv') ) .CSVParse(opts) .map( async (l) => { return await l; }) .each( (l) => { console.log(l); })
node main - as expected node main step - nada node main step-worker - nada
node main
node main step
node main step-worker
Repo: https://github.com/kenzik/scramjet-csvparse-step
Goal is to dynamically inject a field in each row in the CSV to use later in the map function.
map
Checked doing the same with only papaparse and had same issue. May not be supported. Not a scramjet issue.
Should we expect the
step
function in the CSVParse() options to pass the result down the chain?node main
- as expectednode main step
- nadanode main step-worker
- nadaRepo: https://github.com/kenzik/scramjet-csvparse-step
Goal is to dynamically inject a field in each row in the CSV to use later in the
map
function.