File tree Expand file tree Collapse file tree 3 files changed +920
-353
lines changed
Expand file tree Collapse file tree 3 files changed +920
-353
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22const { createReadStream, createWriteStream } = require ( 'fs' ) ;
33const strStream = require ( 'string-to-stream' ) ;
4- const {
5- AsyncParser,
6- transforms : { unwind, flatten }
7- } = require ( 'json2csv' ) ;
4+ const { unwind, flatten } = require ( '@json2csv/transforms' ) ;
5+ const { AsyncParser } = require ( '@json2csv/node' ) ;
86
97const Executor = require ( '@runnerty/module-core' ) . Executor ;
108
@@ -39,10 +37,9 @@ class json2csvExecutor extends Executor {
3937
4038 const output = createWriteStream ( outputPath , { encoding : 'utf8' } ) ;
4139 const asyncParser = new AsyncParser ( opts ) ;
42- const parsingProcessor = asyncParser . fromInput ( input ) . toOutput ( output ) ;
4340
4441 try {
45- await parsingProcessor . promise ( ) ;
42+ asyncParser . parse ( input ) . pipe ( output ) ;
4643 this . end ( this . endOptions ) ;
4744 } catch ( err ) {
4845 this . endOptions . end = 'error' ;
You can’t perform that action at this time.
0 commit comments