web-streams-polyfill
Web Streams, based on the WHATWG spec reference implementation
Last updated 8 years ago by mattiasbuelens .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install web-streams-polyfill 
SYNC missed versions from official npm registry.

web-streams-polyfill

Web Streams, based on the WHATWG spec reference implementation.

build status npm version license Join the chat at https://gitter.im/web-streams-polyfill/Lobby

Links

Usage

This library comes in multiple variants:

  • web-streams-polyfill: a polyfill that replaces the native stream implementations. Recommended for use in web apps supporting older browsers through a <script> tag.
  • web-streams-polyfill/es6: a polyfill targeting ES2015+ environments. Recommended for use in web apps supporting modern browsers through a <script> tag.
  • web-streams-polyfill/es2018: a polyfill targeting ES2018+ environments. Required for ReadableStream async iterable support.
  • web-streams-polyfill/ponyfill: a ponyfill that provides the stream implementations without replacing any globals. Recommended for use in legacy Node applications, or in web libraries supporting older browsers.
  • web-streams-polyfill/ponyfill/es6: a ponyfill targeting ES2015+ environments. Recommended for use in Node 6+ applications, or in web libraries supporting modern browsers.
  • web-streams-polyfill/ponyfill/es2018: a ponyfill targeting ES2018+ environments. Recommended for use in Node 10+ applications.

Each variant also includes TypeScript type definitions, compatible with the DOM type definitions for streams included in TypeScript.

Usage as a polyfill:

<!-- option 1: hosted by unpkg CDN -->
<script src="https://unpkg.com/web-streams-polyfill/dist/polyfill.min.js"></script>
<!-- option 2: self hosted -->
<script src="/path/to/web-streams-polyfill/dist/polyfill.min.js"></script>
<script>
var readable = new ReadableStream();
</script>

Usage as a Node module:

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

Usage as a ES2015 module:

import { ReadableStream } from "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 polyfill/es6 and ponyfill/es6 variants work in any ES2015-compatible environment.

The polyfill/es2018 and ponyfill/es2018 variants work in any ES2018-compatible environment.

Compliance

The polyfill implements version 2c8f35e (21 Feb 2019) of the streams specification.

The type definitions are compatible with the built-in stream types of TypeScript 3.3.

Contributors

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

Current Tags

  • 4.5.1                                ...           latest (22 days ago)
  • 4.0.0-beta.3                                ...           next (5 years ago)

41 Versions

  • 4.5.1                                ...           22 days ago
  • 4.5.0                                ...           a month ago
  • 4.4.0                                ...           a month ago
  • 4.3.0                                ...           6 months ago
  • 4.2.0                                ...           a year ago
  • 4.1.0                                ...           2 years ago
  • 4.0.0                                ...           3 years ago
  • 3.3.3                                ...           3 years ago
  • 3.3.2                                ...           3 years ago
  • 3.3.1 [deprecated]           ...           3 years ago
  • 3.3.0                                ...           3 years ago
  • 4.0.0-beta.3                                ...           5 years ago
  • 4.0.0-beta.2                                ...           5 years ago
  • 3.2.1                                ...           5 years ago
  • 3.2.0                                ...           5 years ago
  • 4.0.0-beta.1                                ...           5 years ago
  • 3.1.1                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.3                                ...           6 years ago
  • 3.0.2                                ...           6 years ago
  • 3.0.1                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.6                                ...           7 years ago
  • 2.0.5                                ...           7 years ago
  • 2.0.4                                ...           7 years ago
  • 2.0.3                                ...           8 years ago
  • 2.0.2                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.3.2                                ...           10 years ago
  • 1.3.1                                ...           10 years ago
  • 1.3.0                                ...           10 years ago
  • 1.2.2                                ...           10 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (2)
Downloads
Total 97
Today 0
This Week 4
This Month 55
Last Day 0
Last Week 23
Last Month 0
Dependencies (0)
None
Dev Dependencies (10)

© 2010 - cnpmjs.org x YWFE | Home | YWFE