Following is the syntax of the method to get a size of a node buffer in bytes:
buf.length;
Returns a size of buffer in bytes.
// example//from ww w.j av a 2s . com var buffer = Buffer.from('test'); // length of the buffer console.log("buffer length: " + buffer.length);