Tutorials References Exercises Menu
Paid Courses

Node.js buffer length Property

❮ Buffer Module


Example

Return the size of a buffer:

var buf = Buffer.from('abc');

console.log(buf.length);
Run example »

Definition and Usage

The length property returns the size of a buffer, in bytes.


Syntax

buffer.length;

Technical Details

Return Value: A Number, representing the size of a buffer
Node.js Version: 0.1.90

❮ Buffer Module