Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/proc/legacy/deps.ts>readAllSync

A better way to work with processes in Deno.
Very Popular
Latest
function readAllSync
import { readAllSync } from "https://deno.land/x/proc@0.21.9/legacy/deps.ts";

Synchronously reads ReaderSync r until EOF (null) and returns the content as Uint8Array.

Examples

Example 1

import { readAllSync } from "https://deno.land/std@0.224.0/io/read_all.ts";

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

// Example from file
const file = Deno.openSync("my_file.txt", {read: true});
const myFileContent = readAllSync(file);
file.close();

Returns

Uint8Array