Blob API
- Planted:
TL;DR: A Blob
in JavaScript is read-only raw data that you can read, store, or send over a network.
A Blob
object has a size
property (in bytes) and a (MIME) type
property. It represents the underlying data but doesn’t expose it directly. You can extract the raw bytes using blob.arrayBuffer()
, for example.
Here, the bytes 116, 111, 102, and 117 represent the ASCII codepoints for the letters ‘t’, ‘o’, ‘f’, and ‘u’.
I’m adding a Blob
polyfill to the Membrane JS runtime (which is a QuickJS fork with persistent state and a browser API layer). I was initially adding a FormData
polyfill, which uses Blob
. The File
API also uses Blob
.