Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verticalOutput with Arrays #62

Open
xp4u1 opened this issue Dec 4, 2019 · 1 comment
Open

verticalOutput with Arrays #62

xp4u1 opened this issue Dec 4, 2019 · 1 comment

Comments

@xp4u1
Copy link

xp4u1 commented Dec 4, 2019

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
@kaue
Copy link
Owner

kaue commented May 23, 2020

@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

@kaue kaue added enhancement and removed bug labels May 23, 2020
@kaue kaue changed the title Vertical Output verticalOutput with Arrays May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants