2.0.9 • Published 16 days ago

it-to-browser-readablestream v2.0.9

Weekly downloads
4
License
Apache-2.0 OR MIT
Repository
github
Last release
16 days ago

it-to-browser-readablestream

codecov CI

Takes an async iterator and turns it into a browser readable stream

About

Turns an (async)iterable into a W3C ReadbleStream.

Example

import toBrowserReadableStream from 'it-to-browser-readablestream'

// This can also be an iterator, async iterator, generator, etc
const values = [Buffer.from([0, 1]), Buffer.from([2, 3])]

const stream = await toBrowserReadableStream(values)

for await (const buf of stream) {
  console.info(buf) // Buffer[0, 1]
}

Install

$ npm i it-to-browser-readablestream

Browser <script> tag

Loading this module through a script tag will make it's exports available as ItToBrowserReadablestream in the global namespace.

<script src="https://unpkg.com/it-to-browser-readablestream/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

2.0.9

16 days ago

2.0.8

16 days ago

2.0.7

17 days ago

2.0.6

6 months ago

2.0.5

9 months ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago