Sign in
Log inSign up

What is the best way to calculate the size of a JSON object in Node.js?

Jeremy Wright's photo
Jeremy Wright
·Apr 28, 2016

My API consumes JSON and saves it in a record. However, I would like to impose a size limit on the object. For example, in MongoDB the document size must be less than 16MB. How should I go about it in Node.js?