How to use the web-streams-polyfill/dist/ponyfill.ReadableStream function in web-streams-polyfill

To help you get started, we’ve selected a few web-streams-polyfill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / pdfjs-dist / lib / shared / streams_polyfill.js View on Github external
if (typeof ReadableStream !== 'undefined') {
    try {
      new ReadableStream({
        start: function start(controller) {
          controller.close();
        }
      });
      isReadableStreamSupported = true;
    } catch (e) {}
  }

  if (isReadableStreamSupported) {
    exports.ReadableStream = ReadableStream;
  } else {
    exports.ReadableStream = require('web-streams-polyfill/dist/ponyfill').ReadableStream;
  }
}

web-streams-polyfill

Web Streams, based on the WHATWG spec reference implementation

MIT
Latest version published 30 days ago

Package Health Score

89 / 100
Full package analysis