Web globals

new Blob()

Creates an immutable byte sequence from supplied parts. Text length in characters may differ from its byte size. Tested on Node.js 22.16.0. Example output (one line per entry): ["2 text/plain \u00e9"].

Formal Syntax & Structure

nodejs syntaxnodejs
new Blob([sources[, options]])

Parameters & Attributes

NameTypeDescription
sourcesArrayData parts.
optionsobjectMedia type and line ending handling.

Return Value

Blob

Immutable byte sequence.

Working Example

Example Snippetnodejs
const b = new Blob(['é'], { type: 'text/plain' });console.log(b.size, b.type, await b.text());
Node.js Reference