Skip to main content

@std/io@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)

Classes

c
BufferFullError(partial: Uint8Array)
No documentation available
  • name: string
    No documentation available
c
BufReader(
rd: Reader,
size?: number
)
No documentation available
  • buffered(): number
    No documentation available
  • create(
    r: Reader,
    size?: number
    ): BufReader

    return new BufReader unless r is BufReader

  • peek(n: number): Promise<Uint8Array | null>

    peek() returns the next n bytes without advancing the reader. The bytes stop being valid at the next read call.

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

    reads data into p. It returns the number of bytes read into p. The bytes are taken from at most one Read on the underlying Reader, hence n may be less than len(p). To read exactly len(p) bytes, use io.ReadFull(b, p).

  • readByte(): Promise<number | null>

    Returns the next byte [0, 255] or null.

  • readFull(p: Uint8Array): Promise<Uint8Array | null>

    reads exactly p.length bytes into p.

  • readLine(): Promise<ReadLineResult | null>

    readLine() is a low-level line-reading primitive. Most callers should use readString('\n') instead or use a Scanner.

  • readSlice(delim: number): Promise<Uint8Array | null>

    readSlice() reads until the first occurrence of delim in the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read.

  • readString(delim: string): Promise<string | null>

    readString() reads until the first occurrence of delim in the input, returning a string containing the data up to and including the delimiter. If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often null). ReadString returns err !== null if and only if the returned data does not end in delim. For simple uses, a Scanner may be more convenient.

  • reset(r: Reader): void

    Discards any buffered data, resets all state, and switches the buffered reader to read from r.

  • size(): number

    Returns the size of the underlying buffer in bytes.

c
No documentation available
  • name: string
    No documentation available
  • partial: Uint8Array
    No documentation available

Interfaces

I

Result type returned by of BufReader.readLine().

  • line: Uint8Array
    No documentation available
  • more: boolean
    No documentation available

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:@std/io

Import symbol

import * as mod from "@std/io/buf_reader";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/io/buf_reader";