title: How to parse JSON object to CSV file using json2csv nodejs module
body: <p>I'm currently learning how to parse a JSON object to a CSV file using the <a href="https://npmjs.org/package/json2csv" rel="noreferrer">json2csv</a> node module. Have never worked with JSON before, so this is all new to me.</p>
  
  <p>My JSON object is formatted like this:</p>
  
  <pre><code>{
   "car":
        {
            "name":["Audi"],
            "price":["40000"],
            "color":["blue"]
        }
  }
  </code></pre>
  
  <p>And the output CSV file is formatted like this:</p>
  
  <pre><code>"car","name","price","color"
  {"name":["Audi"],"price":["40000"],"color":["blue"]},,,
  </code></pre>
  
  <p>How would I be able to get the CSV output to look like this instead?</p>
  
  <pre><code>name, price, color
  "Audi",40000,"blue"
  </code></pre>
  
  <p>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.</p>