Skip to main content
Module

x/netzo/deno.d.ts>Deno.readTextFile

SDK for Netzo, the open Web platform to unify IoT devices, applications and services.
Go to Latest
function Deno.readTextFile
allow-read
import { Deno } from "https://deno.land/x/netzo@v0.1.10/deno.d.ts";
const { readTextFile } = Deno;

Asynchronously reads and returns the entire contents of a file as utf8 encoded string. Reading a directory throws an error.

const data = await Deno.readTextFile("hello.txt");
console.log(data);

Requires allow-read permission.

Parameters

path: string | URL
optional
options: ReadFileOptions

Returns

Promise<string>