Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hono/utils/stream.ts>StreamingApi

Fast, Lightweight, Web-standards
Extremely Popular
Go to Latest
class StreamingApi
import { StreamingApi } from "https://deno.land/x/hono@v4.1.0/utils/stream.ts";

Constructors

new
StreamingApi(writable: WritableStream, _readable: ReadableStream)

Properties

private
abortSubscribers: (() => void | Promise<void>)[]
private
encoder: TextEncoder
private
writable: WritableStream
private
writer: WritableStreamDefaultWriter<Uint8Array>
responseReadable: ReadableStream

Methods

onAbort(listener: () => void | Promise<void>)
sleep(ms: number)
write(input: Uint8Array | string)
writeln(input: string)