1 year ago

#315174

test-img

kmanish75

JSON Stringify large in-memory javascript object. getting error Invalid String length

I know there are many similar question but they all are reading from file.

In my case I already have the object in the memory (>500MB), fetched from Database.

when I use native nodejs Stringify

JSON.stringify(BigFatObject);

It thorw Invalid String length error. Which I assume because of big object size.

My End goal is to convert javascript to JSON String and later save it to aws s3 storage. Time is not a big deal but memory resource is.

I tried JSONStream module. But examples are for read from a file and not when object is already in memory.

javascript

node.js

json

stringify

0 Answers

Your Answer

Accepted video resources