Web Streams, based on the WHATWG spec reference implementation
Clone or download
Pull request Compare This branch is 112 commits ahead, 1 commit behind creatorrr:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ponyfill
spec @ 1116de0
src
types
.eslintrc.json
.gitignore
.gitmodules
CONTRIBUTING.md
LICENSE
README.md
babel.config.js
package-lock.json
package.json
rollup.config.js
run-web-platform-tests-on-bundle.js

README.md

web-streams-polyfill

Web Streams, based on the WHATWG spec reference implementation.
Join the chat at https://gitter.im/web-streams-polyfill/Lobby

Links

Usage

This project comes in three variants:

  • @mattiasbuelens/web-streams-polyfill: a polyfill that replaces the native stream implementations. Recommended for use in web apps through a <script> tag.
  • @mattiasbuelens/web-streams-polyfill/ponyfill: a ponyfill that provides the stream implementations without replacing any globals. Recommended for use in Node applications or web libraries.
  • @mattiasbuelens/web-streams-polyfill/ponyfill/es6: a ponyfill targeting ES2015+ environments. Recommended for use in modern Node applications, or in web apps targeting modern browsers.

Each variant also includes the type definitions for WHATWG streams from DefinitelyTyped.

Usage as a polyfill:

<script src="/path/to/web-streams-polyfill/dist/polyfill.min.js"></script>
<script>
var readable = new ReadableStream();
</script>

Usage as a Node library:

var streams = require("@mattiasbuelens/web-streams-polyfill/ponyfill");
var readable = new streams.ReadableStream();

Usage as a ES2015 module:

import { ReadableStream } from "@mattiasbuelens/web-streams-polyfill/ponyfill";
const readable = new ReadableStream();

Compatibility

The polyfill and ponyfill variants work in any ES5-compatible environment that has a global Promise. If you need to support older browsers or Node versions that do not have a native Promise implementation (check the support table), you must first include a Promise polyfill (e.g. promise-polyfill).

The ponyfill/es6 variant works in any ES2015-compatible environment.

Contributors

Thanks to these people for their work on the original polyfill: