Blob.stream()

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The stream() method of the Blob interface transforms a Blob into a ReadableStream of its data.

Syntax

var stream = blob.stream();

Parameters

None.

Returns

A ReadableStream.

Polyfill

You can polyfill the stream() method in browsers that support the Fetch API with the following code:

Object.defineProperty(Blob.prototype, 'stream', {
  configurable: true,
  enumerable: true,
  writable: true,
  value: function stream() {
    return new Response(this).body;
  }
});

Specifications

Specification Status Comment
File API
The definition of 'Blob.stream()' in that specification.
Working Draft  

Browser compatibility

No compatibility data found. Please contribute data for "api.Blob.stream" (depth: 1) to the MDN compatibility data repository.

See also

Document Tags and Contributors

Contributors to this page: NotWoods
Last updated by: NotWoods,