Closed fauquet-ux closed 4 years ago
version 5.0.3
I know how use flatten with parser. However flatten doesnt work with AsyncParser with the same syntax..
const {AsyncParser, transforms: {flatten}} = require('json2csv') const extract = {} extract.get = function get () { return (req) => { const asyncParser = new AsyncParser({transforms: [flatten({objects: true, arrays: true})]}) let csv = '' asyncParser.processor. on('data', (chunk) => csv += chunk.toString()). on('end', () => console.log(csv)). on('error', (err) => console.error(err)) asyncParser.input.push(JSON.stringify(req.query.data)) asyncParser.input.push(null) } }
Can u help me pls ?
version 5.0.3
I know how use flatten with parser. However flatten doesnt work with AsyncParser with the same syntax..
Can u help me pls ?