Skip to main content

Module buffer

Module buffer 

Source
Expand description

Node Buffer (global + require('buffer').Buffer). A Buffer is a plain object tagged @@native = "Buffer" whose bytes live in a hidden @@bytes array; length is an enumerable data property so buf.length reads directly.

Constants§

BLOB_METHODS
Method names for Blob/File instances (parent instance_has_method).
INSTANCE_METHODS
The methods a Buffer instance answers — the surface instance_call dispatches, and the set installed as @proto:Buffer:<m> thunks on the real Buffer.prototype object.
MODULE_METHODS
Free functions of the buffer module itself (require('buffer').atob, …), as opposed to the Buffer constructor’s static methods above. Needs the parent "buffer" routing arm (see final report).
STATIC_METHODS
The statics on Buffer. node v26.7.0’s Object.getOwnPropertyNames(Buffer).filter(n => typeof Buffer[n] === 'function') reports eleven; this is ten of them.

Functions§

blob_call
Blob/File instance methods. text/arrayBuffer/bytes return already- resolved Promises (Node’s async accessors); slice returns a new Blob. arrayBuffer/bytes resolve with a Buffer (this runtime’s byte container) rather than a bare ArrayBuffer/Uint8Array.
byte_get
buf[i] — the byte at an integer index, or undefined past the end.
byte_set
buf[i] = n — write one byte (truncated to 8 bits, as a Uint8Array does). Returns whether recv was a Buffer and the write landed.
bytes_like
The bytes of any byte-like source: a JS array of byte values, another Buffer, ANY typed array, or an ArrayBuffer. None for anything else (a string, which every caller handles with its own encoding rules).
construct_blob
new Blob(parts[, options]).
construct_file
new File(parts, name[, options]).
from_bytes
Build a Buffer value from raw bytes.
instance_call
Buffer instance methods.
module_call
Dispatch a require('buffer').<method> free function.
static_call