Skip to main content
The Deno 2 Release Candidate is here
Learn more
function ReadTextFile
import { ReadTextFile } from "https://deno.land/x/macromania_assets@v0.2.0/deps.ts";

Reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.

https://deno.land/api@v1.40.3?unstable=true&s=Deno.readTextFile

Parameters

unnamed 0: { path: string | URL; }

Returns

Evaluates to the file contents.