x/oak/deps.ts

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
class LimitedReader
implements [Deno.Reader]
import { LimitedReader } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v11.1.0/deps.ts?s=LimitedReader";

A LimitedReader reads from reader but limits the amount of data returned to just limit bytes. Each call to read updates limit to reflect the new amount remaining. read returns null when limit <= 0 or when the underlying reader returns null.

Constructors

new
LimitedReader(reader: Deno.Reader, limit: number)
[src]

Methods

read(p: Uint8Array): Promise<number | null>[src]