2

I have a massive JSON object (170k lines, around 130Mbs). When running

var stringified = JSON.stringify(jsonObj);

My node.js application hangs and then times out

How can I stringify such a large file without having it timeout?

Adrian E
  • 1,884
  • 3
  • 21
  • 33

1 Answers1

1

Turns out the problem wasn't a result of the large JSON, it was something else...

However, in the process I found that you can use lodash _.chunk to split the json into smaller parts for parallel processing.

var arr = _.chunk(largeObj, SIZE_OF_CHUNKS);
Adrian E
  • 1,884
  • 3
  • 21
  • 33