Skip to content

Function: cache()

cache<TFileSystem>(filesystem, storage, options?): TFileSystem

Decorate a filesystem with read-through caching while preserving its exact concrete type and automatically delegating every uncached member.

Keys use <stable-hash>_<normalized-path>. Mutations enumerate the cache and invalidate every same-filesystem key whose path is an ancestor or descendant of a changed path, covering parent listings plus moved or deleted trees.

TFileSystem extends FileSystem<string>

TFileSystem

FileSystemCache

FileSystemCacheOptions = {}

TFileSystem