isomorphic-web-streams
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

isomorphic-web-streams

standard-readme compliant license NPM version TypeScript types lines of code

Isomorphic Web Streams for Node and the browser.

This library is TypeScript-native, ESM-only, and has zero dependencies. It uses conditional exports to re-export the Web Streams API interface classes from node:stream/web in Node environments and re-export from the global scope using globalThis in all other environments.

Table of Contents

Install

npm i isomorphic-web-streams

Usage

import {
	ReadableStream,
	WritableStream,
	TransformStream,
	ReadableStreamDefaultReader,
	ReadableStreamDefaultController,
	ReadableByteStreamController,
	ReadableStreamBYOBReader,
	ReadableStreamBYOBRequest,
	WritableStreamDefaultWriter,
	WritableStreamDefaultController,
	TransformStreamDefaultController,
	ByteLengthQueuingStrategy,
	CountQueuingStrategy,
} from "isomorphic-web-streams"

const s = new ReadableStream(/* ... */)

Contributing

If you have a suggestion to improve this library, feel free to open an issue to discuss it.

License

MIT © 2023 Joel Gustafson

Package Sidebar

Install

npm i isomorphic-web-streams

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

8.17 kB

Total Files

7

Last publish

Collaborators

  • joelg