Skip to main content

@std/io@0.215.0

latest
Works with
It is unknown whether this package works with Node.js, Deno, Browsers, Cloudflare Workers, Bun
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Browsers
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)

Interfaces

I

An abstract interface which when implemented provides an interface to close files/resources that were previously opened.

  • close(): void

    Closes the resource, "freeing" the backing file/resource.

I

An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.

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

    Reads up to p.byteLength bytes into p. It resolves to the number of bytes read (0 < n <= p.byteLength) and rejects if any error encountered. Even if read() resolves to n < p.byteLength, it may use all of p as scratch space during the call. If some data is available but not p.byteLength bytes, read() conventionally resolves to what is available instead of waiting for more.

I

An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.

  • readSync(p: Uint8Array): number | null

    Reads up to p.byteLength bytes into p. It resolves to the number of bytes read (0 < n <= p.byteLength) and rejects if any error encountered. Even if read() returns n < p.byteLength, it may use all of p as scratch space during the call. If some data is available but not p.byteLength bytes, read() conventionally returns what is available instead of waiting for more.

I

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.

  • write(p: Uint8Array): Promise<number>

    Writes p.byteLength bytes from p to the underlying data stream. It resolves to the number of bytes written from p (0 <= n <= p.byteLength) or reject with the error encountered that caused the write to stop early. write() must reject with a non-null error if would resolve to n < p.byteLength. write() must not modify the slice data, even temporarily.

I

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.

  • writeSync(p: Uint8Array): number

    Writes p.byteLength bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= p.byteLength) and any error encountered that caused the write to stop early. writeSync() must throw a non-null error if it returns n < p.byteLength. writeSync() must not modify the slice data, even temporarily.

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/types";
or

Import directly with a jsr specifier

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