Skip to content

Instantly share code, notes, and snippets.

@bfredo123
Created April 8, 2021 08:02
Show Gist options
  • Save bfredo123/14a2b4f47bfcbdc83afb4748623b0fb3 to your computer and use it in GitHub Desktop.
Save bfredo123/14a2b4f47bfcbdc83afb4748623b0fb3 to your computer and use it in GitHub Desktop.
heap out of memory issue with excel4node
var excel = require('excel4node')
var workbook = new excel.Workbook({})
for (let s = 0; s < 1; s++) {
var sheet = workbook.addWorksheet('Contacts'+s)
for (let rowIndex = 1; rowIndex < 100000; rowIndex++) {
for (i = 0;i < 15; i++) {
sheet.cell(rowIndex, +i+1).string('coucou'+rowIndex+'-'+i)
}
}
}
workbook.write("test.xlsx", function(err, stats) {
if (err) {
console.error("error", err);
} else {
console.log("stats",stats);
}
})
console.log("written")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment