Skip to main content
Module

x/lume/core/reader.ts>default

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
class default
import { default } from "https://deno.land/x/lume@v1.15.2/core/reader.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
default(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