title: How to export an Excel file from JSON with formatting and autofit using FileSaver.js
body: <p>I can already export my JSON data to Excel with these functions:</p>
  
  <pre><code>  public exportAsExcelFile(json: any[], excelFileName: string) :Promise&lt;Object&gt; {
  
      const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);
      const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };
      const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
      return (this.saveAsExcelFile(excelBuffer, excelFileName));
  
    }
  
    private saveAsExcelFile(buffer: any, fileName: string):Promise&lt;Object&gt;  {
      const data: Blob = new Blob([buffer], {type: EXCEL_TYPE});
      return await FileSaver.saveAs(data, fileName + '-' + new  Date().toString()+ EXCEL_EXTENSION);
   }
  </code></pre>
  
  <p>But I can't figure out how to format this file, so I can at least have the bold header and the cells with autofit.</p>