I want to parse an array of objects into xlsx-populate so it can give me the excel file.
const xlsxPopulate = require('xlsx-populate');
const worksheet = await xlsxPopulate.fromBlankAsync();
const sheet1 = worksheet.sheet('Sheet1');
sheet1.cell('A1').value(newArray);
await worksheet.toFileAsync('./myFileName.xlsx');
It works for Arrays or Arrays(
[[..][..]]) usingrangeor using single cell as well.From the doc:
So all you need to do is converting objects to CSV maybe for an example JS object:
Modified(only removed the
.joins) From this answer: