Skip to main content

@std/streams@0.215.0

latest
Works with
It is unknown whether this package works with Node.js, Deno, Browsers, Cloudflare Workers, Bun
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)
class LimitedTransformStream
extends TransformStream<T, T>

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.

Examples

Example 1

import { LimitedTransformStream } from "@std/streams/limited_transform_stream";
const res = await fetch("https://example.com");
const parts = res.body!.pipeThrough(new LimitedTransformStream(50));

Constructors

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

Constructs a new instance.

Type Parameters

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/streams

Import symbol

import { LimitedTransformStream } from "@std/streams/limited_transform_stream";
or

Import directly with a jsr specifier

import { LimitedTransformStream } from "jsr:@std/streams/limited_transform_stream";