Skip to main content
Module

x/uuid/lib/lib.deno_runtime.d.ts>Deno.read

Deprecated! UUID is part of the deno standard library
Latest
function Deno.read
import { Deno } from "https://deno.land/x/uuid@v0.1.2/lib/lib.deno_runtime.d.ts";
const { read } = Deno;

Read from a file ID into an array buffer.

Resolves with the ReadResult for the operation.

  (async () => {
    const file = await Deno.open("/foo/bar.txt");
    const buf = new Uint8Array(100);
    const { nread, eof } = await Deno.read(file.rid, buf);
    const text = new TextDecoder().decode(buf);
  })();

Parameters

rid: number
p: Uint8Array