readable-stream-polyfill

0.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i readable-stream-polyfill

Weekly Downloads

69

Version

0.0.0

License

MIT

Unpacked Size

28.9 kB

Total Files

26

Last publish

Collaborators

  • kettanaito