Bun Convert a Buffer to a blob

Convert a Buffer to a blob

jarle Updated

File contents

Convert a Buffer to a blob

A Blob can be constructed from an array of "chunks", where each chunk is a string, binary data structure (including Buffer), or another Blob.

const buf = Buffer.from("hello");
const blob = new Blob([buf]);

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-blob commit 3d5f281a8f

Frequently asked questions

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