Quantcast
Channel: NodeJs get size of variable in bytes - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Tronix117 for NodeJs get size of variable in bytes

Like img is a buffer, you can simply use img.length, it will give you the size in octets (byte of 8bits)

View Article


NodeJs get size of variable in bytes

I have a variable 'img' which is an image file that has been loaded via:var img = fs.readFileSync('./tmp.png');How do I determine how many bytes the 'img' variable is?

View Article

Browsing latest articles
Browse All 2 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>