Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mattiasbuelens/web-streams-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mattiasbuelens/web-streams-polyfill

Web Streams, based on the WHATWG spec reference implementation

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Usage

This library comes in multiple variants:

  • @mattiasbuelens/web-streams-polyfill: a polyfill that replaces the native stream implementations. Recommended for use in web apps supporting older browsers through a <script> tag.
  • @mattiasbuelens/web-streams-polyfill/es6: a polyfill targeting ES2015+ environments. Recommended for use in web apps supporting modern browsers through a <script> tag.
  • @mattiasbuelens/web-streams-polyfill/es2018: a polyfill targeting ES2018+ environments. Required for ReadableStream async iterable support.
  • @mattiasbuelens/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.
  • @mattiasbuelens/web-streams-polyfill/ponyfill/es6: a ponyfill targeting ES2015+ environments. Recommended for use in Node 6+ applications, or in web libraries supporting modern browsers.
  • @mattiasbuelens/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/@mattiasbuelens/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("@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 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:

Keywords

FAQs

Package last updated on 10 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc