juanjoDiaz / json2csv

Flexible conversion between JSON and CSV
https://juanjodiaz.github.io/json2csv/
MIT License
306 stars 32 forks source link

TypeError: AsyncParser is not a constructor #25

Closed sshehab1 closed 1 year ago

sshehab1 commented 1 year ago
  1. Include the version of json2csv used and the interface that you are using (plainjs, node or whatwg). node
  2. Include your node version or your browser vendor and version. 16
  3. Include the command or code you used.
    const { AsyncParser } = ('@json2csv/node');
    const parser = new AsyncParser();
    const csvString = await parser.parse(jsonArray).promise();
  4. Include a sample dataset that we can test against.
  5. Include your expected output and the actual output/error.

TypeError: AsyncParser is not a constructor

sshehab1 commented 1 year ago

nvm it's supposed to be const { AsyncParser } = require('@json2csv/node');