Bun Convert a DataView to a string

Convert a DataView to a string

jarle Updated

File contents

Convert a DataView to a string

If a DataView contains ASCII-encoded text, you can convert it to a string using the TextDecoder class.

const dv: DataView = ...;
const decoder = new TextDecoder();
const str = decoder.decode(dv);

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

jarle/bun-skills/tree/main/skills/bun-guides-binary-dataview-to-string commit db8dea32f4

Frequently asked questions

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