Function readAll

  • Read Reader r until EOF (null) and resolve to the content as Uint8Array.

    Parameters

    • reader: Reader

      The reader to read from

    Returns Promise<Uint8Array>

    The content as Uint8Array

    import { readAll } from "@std/io/read-all";

    // Example from stdin
    const stdinContent = await readAll(Deno.stdin);

    // Example from file
    using file = await Deno.open("my_file.txt", {read: true});
    const myFileContent = await readAll(file);