Encapsulates immutable, raw data that can be safely shared across workers.

Available as a global and via require('node:buffer').Blob.

See also:

Constructor

new(?sources:Array<BlobPart>, ?options:BlobPropertyBag)

Variables

read onlysize:Int

The total size of the Blob in bytes.

read onlytype:String

The content-type of the Blob.

Methods

arrayBuffer():Promise<ArrayBuffer>

Returns a promise that fulfills with an ArrayBuffer containing a copy of the Blob data.

bytes():Promise<Uint8Array>

Returns a promise that fulfills with a Uint8Array containing a copy of the Blob data.

slice(?start:Int, ?end:Int, ?type:String):Blob

Creates and returns a new Blob containing a subset of this Blob's data.

stream():ReadableStream

Returns a new ReadableStream that allows the content of the Blob to be read.

text():Promise<String>

Returns a promise that fulfills with the contents of the Blob decoded as a UTF-8 string.