Reputation: 2806
It's not recommended to send a lot of bytes between processes in Node, proven here: https://stackoverflow.com/a/27327402/2440515
Node first JSON.stringify the object. How can I actually measure a size of a string to avoid transferring to much data? Is length equal to bytes?
Upvotes: 2
Views: 3183
Reputation: 161457
The easiest way is to use Buffer
's helper functions.
Buffer.byteLength(str)
Upvotes: 2