Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/js/deno.ts>readFile

A modern runtime for JavaScript and TypeScript.
Go to Latest
function readFile
import { readFile } from "https://deno.land/x/deno@v0.30.0/cli/js/deno.ts";

Read the entire contents of a file.

  const decoder = new TextDecoder("utf-8");
  const data = await Deno.readFile("hello.txt");
  console.log(decoder.decode(data));

Parameters

filename: string

Returns

Promise<Uint8Array>