万能的node生态,直接上npm包 xlsx-populate
const XlsxPopulate = require('xlsx-populate');
XlsxPopulate.fromBlankAsync().then(workbook => {
workbook.sheet("Sheet1").cell("A1").value("Some sample text");
return workbook.toFileAsync("./Book1.xlsx", { password: "S3cret!" });
});