Skip to main content
Go to Latest
class LimitedTransformStream
extends TransformStream<T, T>
import { LimitedTransformStream } from "";

A TransformStream that will only read & enqueue size amount of chunks.

If options.error is set, then instead of terminating the stream, an error will be thrown.


Example 1

import { LimitedTransformStream } from "";
const res = await fetch("");
const parts = res.body!.pipeThrough(new LimitedTransformStream(50));


LimitedTransformStream(size: number, options?: { error?: boolean; })

Constructs a new instance.