Blob.prototype.stream

Returns a readable stream that reads the contents of the blob.

Syntax

stream()

Return value

A readable stream.

Currently, the readable stream can only be used as an async iterator.

Example

let blob = new Blob(['Hello, world!'])
for await (let chunk of blob.stream()) {
  print(new TextDecoder().decode(chunk))
}
Hello, world!