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

x/hono/utils/stream.ts>StreamingApi

Web Framework built on Web Standards
Very Popular
Go to Latest
class StreamingApi
import { StreamingApi } from "https://deno.land/x/hono@v4.2.8/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)