Creates a new Blob
object containing a concatenation of the given sources.
{ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into the 'Blob' and can therefore be safely modified after the 'Blob' is created.
String sources are also copied into the Blob
.
Optional
options: BlobOptionsReadonly
sizeThe total size of the Blob
in bytes.
v15.7.0, v14.18.0
Readonly
typeThe content-type of the Blob
.
v15.7.0, v14.18.0
Returns a promise that fulfills with an ArrayBuffer containing a copy of
the Blob
data.
v15.7.0, v14.18.0
The blob.bytes()
method returns the byte of the Blob
object as a Promise<Uint8Array>
.
const blob = new Blob(['hello']);
blob.bytes().then((bytes) => {
console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
});
v20.16.0
Creates and returns a new Blob
containing a subset of this Blob
objects
data. The original Blob
is not altered.
Optional
start: numberThe starting index.
Optional
end: numberThe ending index.
Optional
type: stringThe content-type for the new Blob
v15.7.0, v14.18.0
Returns a new ReadableStream
that allows the content of the Blob
to be read.
v16.7.0
A
Blob
encapsulates immutable, raw data that can be safely shared across multiple worker threads.Since
v15.7.0, v14.18.0