AnyMux

API Reference

CachedFileSystem

Wraps an IFileSystem with an in-memory cache layer.

Constructor

new CachedFileSystem(options: CachedFileSystemOptions)

Options

OptionTypeDescription
fsIFileSystemThe file system to cache
ttlnumber?Cache TTL in milliseconds
maxSizenumber?Maximum number of cached entries

Methods

Implements all IFileSystem methods: readFile, writeFile, readDir, stat, mkdir, rm, exists.

Additional Methods

MethodDescription
invalidate(path)Remove a specific path from cache
clear()Clear the entire cache