Skip to content

"ReadableStream" polyfill based on the eponymous implementation from Node.js.

Notifications You must be signed in to change notification settings

kettanaito/readable-stream-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReadableStream

A WHATWG-compliant polyfill for ReadableStream based on the eponymous implementation in Node.js.

Install

npm install readable-stream-polyfill

Node.js API

const { ReadableStream } = require('readable-stream-polyfill')

const stream = new ReadableStream({
  start(controller) {
    controller.enqueue('hello')
    controller.enqueue('world')
    controller.end()
  },
})

const reader = await stream.getReader()

Polyfill

// Polyfills the global "ReadableStream" class
// if it's not already implemented.
require('readable-stream-polyfill/globals')

Usage

About

"ReadableStream" polyfill based on the eponymous implementation from Node.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published