Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lume/core.ts>Reader

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
class Reader
Re-export
import { Reader } from "https://deno.land/x/lume@v1.15.3/core.ts";

Class to read directories, files and store the content in a cache It's used to avoid reading the same file multiple times

Constructors

new
Reader(options: Options)

Properties

cache: Map<string, Promise<Data> | Data>
remoteFiles: Map<string, string>
src: string

Methods

Delete all the cache

deleteCache(path: string)

Delete a file from the cache

getFullPath(path: string): string

Resolve the full path of a path

getInfo(path: string): Promise<FileInfo | undefined>

Returns the file info of a path

read(path: string, loader: Loader): Promise<Data>

Read a file using a loader and return the content

readDir(path: string): AsyncIterable<DirEntry>

Reads a directory

remoteFile(filename: string, url: string)

Register a remote file

saveCache(path: string, data: Promise<Data> | Data)

Cache a file