Bun Convert a Buffer to an ArrayBuffer

Convert a Buffer to an ArrayBuffer

jarle Updated

File contents

Convert a Buffer to an ArrayBuffer

The Node.js Buffer class provides a way to view and manipulate data in an underlying ArrayBuffer, which is available via the buffer property.

const nodeBuf = Buffer.alloc(64);
const arrBuf = nodeBuf.buffer;

See Docs > API > Binary Data for complete documentation on manipulating binary data with Bun.

jarle/bun-skills/tree/main/skills/bun-guides-binary-buffer-to-arraybuffer commit 7dcdf56678

Frequently asked questions

npx skillmds@latest add jarle/bun-convert-a-buffer-to-an-arraybuffer