Skip to main content
Module

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

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

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

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

Requires allow-read permission.

Parameters

path: string | URL

Returns

string