Skip to main content
Home

Built and signed on GitHub Actions

Chunking TransformStream for Deno

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.2.0)
class ChunkedStream
extends TransformStream<T | T[], T[]>

Chunking TransformStream

Examples

Example 1

import { ChunkedStream } from "jsr:@4513echo/chunked-stream";

const stream = new ReadableStream({
  start(controller) {
    let i = 0;
    while (true) {
      controller.enqueue(i);
      i++;
    }
  },
})
  .pipeThrough(new ChunkedStream({ chunkSize: 4 }));

for await (const chunk of stream) {
  console.log(chunk); // [0, 1, 2, 3], [4, 5, 6, 7], ...
}

Constructors

new
ChunkedStream(option?: ChunkedStreamOptions)

Type Parameters

New Ticket: 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:@4513echo/chunked-stream

Import symbol

import { ChunkedStream } from "@4513echo/chunked-stream";
or

Import directly with a jsr specifier

import { ChunkedStream } from "jsr:@4513echo/chunked-stream";

Add Package

pnpm i jsr:@4513echo/chunked-stream
or (using pnpm 10.8 or older)
pnpm dlx jsr add @4513echo/chunked-stream

Import symbol

import { ChunkedStream } from "@4513echo/chunked-stream";

Add Package

yarn add jsr:@4513echo/chunked-stream
or (using Yarn 4.8 or older)
yarn dlx jsr add @4513echo/chunked-stream

Import symbol

import { ChunkedStream } from "@4513echo/chunked-stream";

Add Package

vlt install jsr:@4513echo/chunked-stream

Import symbol

import { ChunkedStream } from "@4513echo/chunked-stream";

Add Package

npx jsr add @4513echo/chunked-stream

Import symbol

import { ChunkedStream } from "@4513echo/chunked-stream";

Add Package

bunx jsr add @4513echo/chunked-stream

Import symbol

import { ChunkedStream } from "@4513echo/chunked-stream";