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.
Interfaces 5
- interface Blob
- interface BlobPropertyBag
- interface Buffer
A typed array of 8-bit unsigned integer values.
- interface File
- interface FilePropertyBag