Skip to main content
Module

x/silicon/deps.ts>io.LimitedReader

Deno module to generate images from source code using Aloxaf/silicon.
Go to Latest
class io.LimitedReader
implements [Deno.Reader]
import { io } from "https://deno.land/x/silicon@v0.0.2/deps.ts";
const { LimitedReader } = io;

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)

Methods

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