fs_fetch_value_cache.ts

Declarations
#

2 declarations

view source

create_fs_fetch_value_cache
#

fs_fetch_value_cache.ts view source

(name: string, dir?: string): Promise<FetchCache>

Creates file-system backed cache for belt's fetch.js API responses.

Cache invalidation strategy: If cache file can't be read or parsed, entire cache is cleared (delete file) and starts fresh. This handles format changes.

Uses structuredClone to track changes - only writes to disk if data modified. Formatted with Prettier before writing for version control friendliness.

name

cache filename (without .json extension)

type string

dir

cache directory (defaults to .gro/build/fetch/)

type string
default join(paths.build, 'fetch')

returns

Promise<FetchCache>

cache object with Map-based data and save() method

FetchCache
#

Imported by
#