@ende/streams
ende add jsr:@ende/streamsVersion 2026.10.15 on JSR.
Utilities for working with the Streams API.
Includes buffering and conversion.
import { toText } from "@ende/streams";
import { assertEquals } from "@ende/assert";
const stream = ReadableStream.from(["Hello, world!"]);
const text = await toText(stream);
assertEquals(text, "Hello, world!");
Modules
@ende/streams/batch-stream@ende/streams/buffer@ende/streams/byte-slice-stream@ende/streams/concat-readable-streams@ende/streams/delimiter-stream@ende/streams/early-zip-readable-streams@ende/streams/limited-bytes-transform-stream@ende/streams/limited-transform-stream@ende/streams/merge-readable-streams@ende/streams/text-delimiter-stream@ende/streams/text-line-stream@ende/streams/to-array-buffer@ende/streams/to-blob@ende/streams/to-bytes@ende/streams/to-json@ende/streams/to-text@ende/streams/to-transform-stream@ende/streams/unstable-abort-stream@ende/streams/unstable-capped-delimiter-stream@ende/streams/unstable-fixed-chunk-stream@ende/streams/unstable-to-byte-stream@ende/streams/unstable-to-lines@ende/streams/zip-readable-streams
Exports
BatchStream— A TransformStream that groups input chunks into fixed-size batches. Emits a `T[]` once `size` input chunks have been collected and flushes any final non-empty partial batch when the input closes.Buffer— A variable-sized buffer of bytes with `readable` and `writable` getters that allows you to work with Web Streams API.BufferBytesOptions— Options for Buffer.bytes.ByteSliceStream— A transform stream that only transforms from the zero-indexed `start` and `end` bytes (both inclusive).concatReadableStreams— Concatenates multiple `ReadableStream`s into a single ordered `ReadableStream`.DelimiterDisposition— Disposition of the delimiter for DelimiterStreamOptions.DelimiterStream— Divide a stream into chunks delimited by a given byte sequence.DelimiterStreamOptions— Options for DelimiterStream.earlyZipReadableStreams— Merge multiple streams into a single one, taking order into account, and each stream will wait for a chunk to enqueue before the next stream can append another chunk.LimitedBytesTransformStream— A TransformStream that will only read & enqueue chunks until the total amount of enqueued data exceeds `size`. The last chunk that would exceed the limit will NOT be enqueued, in which case a RangeError is thrown when `options.error` is set to true, otherwise the stream is just terminated.LimitedBytesTransformStreamOptions— Options for LimitedBytesTransformStream.LimitedTransformStream— A TransformStream that will only read & enqueue `size` amount of chunks.LimitedTransformStreamOptions— Options for LimitedTransformStreammergeReadableStreams— Merge multiple streams into a single one, not taking order into account. If a stream ends before other ones, the other will continue adding data, and the finished one will not add any more data.TextDelimiterStream— Transform a stream `string` into a stream where each chunk is divided by a given delimiter.TextLineStream— Transform a stream into a stream where each chunk is divided by a newline, be it `\n` or `\r\n`. `\r` can be enabled via the `allowCR` option.TextLineStreamOptions— Options for TextLineStream.toArrayBuffer— Converts a ReadableStream of Uint8Arrays to an ArrayBuffer. Works the same as Response.arrayBuffer.toBlob— Converts a ReadableStream of Uint8Arrays to a Blob. Works the same as Response.blob.toBytes— Converts a ReadableStream of Uint8Arrays to a Uint8Array. Works the same as Response.bytes.toJson— Converts a https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON-formatted ReadableSteam of strings or Uint8Arrays to an object. Works the same as Response.json and Request.json, but also extends to support streams of strings.toText— Converts a ReadableSteam of strings or Uint8Arrays to a single string. Works the same as Response.text and Request.text, but also extends to support streams of strings.toTransformStream— Convert the generator function into a TransformStream.zipReadableStreams— Merge multiple streams into a single one, taking order into account, and each stream will wait for a chunk to enqueue before the next stream can append another chunk.