@lucid-softworks/http-body-stream
v0.1.0
Published
Web byte stream construction and bounded collection.
Maintainers
Readme
@lucid-softworks/http-body-stream
Web byte-stream construction and bounded collection.
import {
byteStream,
collectByteStream,
} from "@lucid-softworks/http-body-stream";
const stream = byteStream([new Uint8Array([1, 2, 3])]);
const bytes = await collectByteStream(stream, 1_000_000);Oversized streams are cancelled before HttpStreamTooLargeError is thrown.
null bodies collect to an empty byte array.
