nullxlsx.js Example

// Data should be array of array
var data = [['Title 1', 'Title 2'], 
  ['Carl', 12.4, new Date(2017, 7 - 1, 10)], 
  ['Mia', 678, new Date()]
];

// Create xlsl
var xlsx = new NullXlsx('test.xlsx')
  .addSheetFromData(data, 'Sheet name');

// Generate a link to download the file
document.getElementById("container").appendChild(xlsx.createDownloadLink('Download test.xlsx'));