Node.js Buffer

Pushpendra Tyagi
1 min readApr 16, 2020

--

Buffer

A Buffer can be understood as a storage unit for binary code. The buffers are used to temporarily store the binary data before or after its transmission. Buffers are used to send and receive data smoothly between the sender and receiver.

Node.js buffer module

To handle the various binary data streams and file system operations, we can use the Buffer class from the buffer module in Node. The Buffer octets are used in Node to deal with TCP streams, to support buffer operations, to perform several file IO operations and to interact with the operating system itself because all these operations are performed upon binary data.

The Buffer class, which is a subclass of the Uint8Array class from JavaScript is a global class and contains several other important methods to support additional functionalities. It means Node.js APIs can accept plain Uint8Arrays wherever Buffers are supported as well. Buffer class can be accessed in any application without importing the buffer module as it is a global class.

ProgrammingHunk Node.js Buffer module

--

--