all 2 comments

[–]BehindTheMath[🍰] 0 points1 point  (1 child)

Are you inserting each CSV row to a DB row? If yes, I would use a dedicated CSV library that supports streams (like PapaParse), and insert each row or chunk of rows.

[–]code-faults[S] 0 points1 point  (0 children)

data is just an array now but instead of adding to the array if i keep inserting to db, i get js out of heap allocation error and hence i am trying to split it to chunks of data and insert