What is the best way to calculate the size of a JSON object in Node.js?
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?