jsonexport
jsonexport copied to clipboard
verticalOutput with Arrays
The vertical output option isn't working.
jsonexport(
// example data
[
{
name: "Paul",
xp: 26
},
{
name: "Joshi",
xp: 87
},
{
name: "Jakob",
xp: 120
}
],
{ rowDelimiter: ";", verticalOutput: true },
(error, csv) => {
if (error) return console.error(error);
console.log(csv);
}
);
The output is with true
and false
:
name;xp
Paul;26
Joshi;87
Jakob;120
But should be:
name;Paul;Joshi;Jakob
xp;26;87;120
@xp4u1 currently the vertialOutput only works if you are sending an object to jsonexport.
verticalOutput - Boolean Set this option to false to create a horizontal output for JSON Objects, headers in the first row, values in the second.
I will keep this issue as an enhancement to add support for vertialOutput for Arrays