zemirco / json2csv

Convert json to csv with column titles
http://zemirco.github.io/json2csv
MIT License
2.72k stars 362 forks source link

Cannot read property 'string' of undefined when using stringFormatter #508

Closed sebastian-raubach closed 2 years ago

sebastian-raubach commented 3 years ago

I'm using the following setup:

I'm trying to use this example: https://github.com/zemirco/json2csv/blob/master/docs/parser-examples.md#use-custom-formatting

However, doing so throws the following error:

TypeError: Cannot read property 'string' of undefined

for this line from the example:

const {
  Parser,
  formatters: { string: stringFormatter },
} = require('json2csv');

I'm sure it's something obvious, but I cannot figure it out.

knownasilya commented 3 years ago

Formatters are in the master branch only and scheduled for a v6 release. To use latest published version see the docs on npm.

juanjoDiaz commented 2 years ago

Closing since there was no response