Node.js module

buffer

The 'node:buffer' module provides a way to handle raw binary data directly in memory. Buffers are instances of the Buffer class, which is a fixed-length sequence of bytes.

The module includes methods to create, read, write, concatenate, and compare buffers. It is fundamental for I/O operations, such as reading files, handling network streams, and interfacing with C++ addons.

Fully supported in Bun

Fully implemented.

Functions 6

  • buffer.atob()

    MDN Reference

  • buffer.btoa()

    MDN Reference

  • buffer.isAscii()

    This function returns true if input contains only valid ASCII-encoded data, including the case in which input is empty.

  • buffer.isUtf8()

    This function returns true if input contains only valid UTF-8-encoded data, including the case in which input is empty.

  • buffer.resolveObjectURL()

    Resolves a 'blob:nodedata:...' an associated Blob object registered using a prior call to URL.createObjectURL().

  • buffer.transcode()

    Re-encodes the given Buffer or Uint8Array instance from one character encoding to another.

Interfaces 5

Types 4

Variables 7