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

x/pup/plugins/web-interface/deps.ts>Bundlee

Universal process manager built in Deno
Go to Latest
class Bundlee
import { Bundlee } from "https://deno.land/x/pup@1.0.0-rc.12/plugins/web-interface/deps.ts";

Properties

private
cache: Record<string, Metadata>
private
optional
loadedBundle: Record<string, Metadata>

Methods

private
bundleFiles(basePath: string, fileList: string[]): Promise<Record<string, Metadata>>

Bundle files into a single JSON object.

private
getContentType(filePath: string): string
private
recursiveReaddir(path: string, extensionFilter?: string[]): Promise<string[]>

Recursively read a directory and return a list of files.

bundle(
basePath: string,
path: string,
exts?: string[],
): Promise<Record<string, Metadata>>

Bundle files from a directory into a single JSON object.

get(filePath: string): Promise<Metadata>

Get the content of a file from a JSON bundle.

has(filePath: string): boolean

Checks if a file exists in a JSON bundle.

import(fileUrl: string, importType?: "import" | "fetch" | "local")

Imports a bundle JSON file.

Used by the load()-factory

importAsModule(fileUrl: string)

Imports a bundle JSON file using the import() function.

importLocal(fileUrl: string)

Imports a bundle JSON file from the local filesystem.

importRemote(fileUrl: string)

Imports a bundle JSON file using the fetch() function.

preloadCache(): Promise<void>

Preloads the cache with all the files in the bundle.

restore(targetPath: string): Promise<void>

Restores all files in the bundle to the filesystem, including their modified time.

Static Methods

load(fileUrl: string, importType?: "import" | "fetch" | "local"): Promise<Bundlee>

Factory function that loads a bundle JSON file and creates a new instance of Bundlee.