I'm trying to export data from a file and add this data to an Excel file using ExcelJS.
worksheet.addRows(freedomRawData.records);
'records' is an array that contains more than 165,000 elements in it. While writing the data to excel file, I get the error -
FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
The same script works for data with 'record' length 115,000 elements. Over the internet, I found the below method:
node --max-old-space-size=8192 <file_name>.js
This didn't work and I tried using the maximum capacity of my RAM (16384MB); which didn't help as well. I'm a newbie in NodeJS, and any help would be much appreciated.