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
trueifinputcontains only valid ASCII-encoded data, including the case in whichinputis empty. - buffer.isUtf8()
This function returns
trueifinputcontains only valid UTF-8-encoded data, including the case in whichinputis empty. - buffer.resolveObjectURL()
Resolves a
'blob:nodedata:...'an associatedBlobobject registered using a prior call toURL.createObjectURL(). - buffer.transcode()
Re-encodes the given
BufferorUint8Arrayinstance from one character encoding to another.
Classes 2
- class buffer.Blob
A
Blobencapsulates immutable, raw data that can be safely shared across multiple worker threads. - class buffer.File
A
Fileprovides information about files.
Interfaces 3
- interface BlobOptions
- interface Buffer
A typed array of 8-bit unsigned integer values.
- interface FileOptions