browser-stream-util
utility functions for web streams
API
Table of Contents
iteratorToStream
Converts an iterator into a ReadableStream.
Parameters
Returns ReadableStream
stringToStream
Encodes a string into a ReadableStream.
Parameters
Returns ReadableStream
uint8ToStream
Encodes a uint8 array into a ReadableStream.
Parameters
Returns ReadableStream
streamToString
Reads web stream content into a string.
Parameters
stream
ReadableStream decoder
TextDecoder? (optional, default new TextDecoder()
)
Returns Promise<string>
streamToUint8Array
Reads web stream content into a Uint8Array.
Parameters
Returns Promise<Uint8Array>
emptyStream
Delivers a zero length ReadableStream with no data.
Returns ReadableStream
install
With npm do:
npm install browser-stream-util
license
BSD-2-Clause