title: Export array of JSON objects to Excel using SheetJS
body: <p>I have an array of JSON objects, like this:</p>
  <pre class="lang-json prettyprint-override"><code>[
    {&quot;name&quot;:&quot;John&quot;, &quot;city&quot;: &quot;Seattle&quot;},
    {&quot;name&quot;:&quot;Mike&quot;, &quot;city&quot;: &quot;Los Angeles&quot;},
    {&quot;name&quot;:&quot;Zach&quot;, &quot;city&quot;: &quot;New York&quot;}
  ]
  </code></pre>
  <p>when I use the code below, it's not working:</p>
  <pre class="lang-js prettyprint-override"><code>     _export: function(records,opts) {
                      var XLSX = xlsx;
                      var fileName = opts.split(&quot;.&quot;)[2]
                      var workSheet = XLSX.utils.json_to_sheet(records);
                      console.log(&quot;THis is Worksheet&quot;,workSheet);
                      var wb = XLSX.utils.book_new();
                      console.log(&quot;THis is workbook&quot;,wb)
                      XLSX.utils.book_append_sheet(wb, workSheet, fileName);
                      
                      var bin = XLSX.write(wb, {bookType:'xlsx',type: &quot;binary&quot;});
                      return new Blob([this._binStr2ArrBuff(bin)], { type: &quot;&quot; });
                  },
              },
  </code></pre>
  <p>I'm using SheetJS version 0.9.11, just wanted to check if there is any way  to export it into Excel format? I'm stuck here for the last 2 days.
  Any help would be highly appreciated.</p>