npm.io
1.3.7 • Published 9 months ago

browser-stream-util

Licence
MIT
Version
1.3.7
Deps
0
Size
15 kB
Vulns
0
Weekly
0
Stars
1

npm License Typed with TypeScript bundlejs downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

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
  • stream ReadableStream
  • maxByteLength number

Returns Promise<Uint8Array>

streamToUint8Array

Reads web stream content into a Uint8Array.

Parameters
  • stream ReadableStream

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

Keywords