Skip to content
Advertisement

Create big json object js

I am using Nodejs to Create a JSON file from a really large JSON object (1GB). In order to avoid memory problems, I’m using createWriteStream :

JavaScript

After using Builder(custom function ) it will return a big object JSON.

the final step is to create this file :

JavaScript

but unfortunately, JSON.stringify cannot be used with such heavy Object

JSON.stringify throws RangeError: Invalid string length for huge objects

Is there a solution to this issue, please?

Advertisement

Answer

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement