I'm currently learning how to parse a JSON object to a CSV file using the json2csv node module. Have never worked with JSON before, so this is all new to me.
My JSON object is formatted like this:
{
"car":
{
"name":["Audi"],
"price":["40000"],
"color":["blue"]
}
}
And the output CSV file is formatted like this:
"car","name","price","color"
{"name":["Audi"],"price":["40000"],"color":["blue"]},,,
How would I be able to get the CSV output to look like this instead?
name, price, color
"Audi",40000,"blue"
I understand I can call fields directly for just regular JSON data, but I don't understand how it would work under a JSON object.
