Skip to content
NewBun 1.4.5 is out. Release notes
AphrodyBun

Guides · Binary Data

Convert a Uint8Array to a Blob

Create a Blob from a Uint8Array by passing it as a chunk to the Blob constructor.

You can construct a Blob from an array of "chunks", where each chunk is a string, binary data structure (including Uint8Array), or another Blob.

const arr = new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f]);
const blob = new Blob([arr]);
console.log(await blob.text());
// => "hello"

See Binary Data.