{ } qjs-modules

blob

Source: quickjs-blob.c — module export: Blob

A WHATWG-style Blob: an immutable chunk of binary data with a MIME type.

Constructor

new Blob(parts[, options])   // length 1

parts is an array of strings / ArrayBuffers / typed arrays / other Blobs that are concatenated; options may carry a type (MIME) string.

Methods

MethodArgsDescription
arrayBuffer()0Returns a promise resolving to the blob's contents as an ArrayBuffer.
bytes()0Returns the blob's contents as a Uint8Array.
text()0Returns a promise resolving to the contents decoded as a UTF-8 string.
stream()0Returns a ReadableStream over the blob's bytes.
slice(start, end, contentType)0Returns a new Blob covering the byte range [start, end), optionally with a new MIME type.

Properties (read-only)

PropertyDescription
sizeLength of the blob in bytes (enumerable).
typeMIME type string.
[Symbol.toStringTag]"Blob".