Created
April 8, 2021 08:02
-
-
Save bfredo123/14a2b4f47bfcbdc83afb4748623b0fb3 to your computer and use it in GitHub Desktop.
heap out of memory issue with excel4node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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