To create an Excel File with Node.js, we use the xlsx module.
For instance, we write
const XLSX = require("xlsx");
const wb = XLSX.utils.book_new();
XLSX.writeFile(wb, "out.xlsx");
to call the book_new method to create a new Excel workbook.
Then we call writeGile to write the wb workbook to out.xlsx.