Bun Convert an ArrayBuffer to a string

Convert an ArrayBuffer to a string

jarle Updated

File contents

Convert an ArrayBuffer to a string

Bun implements the Web-standard TextDecoder class for converting between binary data types and strings.

const buf = new ArrayBuffer(64);
const decoder = new TextDecoder();
const str = decoder.decode(buf);

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

jarle/bun-skills/tree/main/skills/bun-guides-binary-arraybuffer-to-string commit fc7ab0997d

Frequently asked questions

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