MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / writeCache

Function writeCache

packages/cli/src/registry/remote.ts:60–69  ·  view source on GitHub ↗
(path: string, data: T)

Source from the content-addressed store, hash-verified

58}
59
60function writeCache<T>(path: string, data: T): void {
61 try {
62 mkdirSync(dirname(path), { recursive: true });
63 const entry: CacheEntry<T> = { fetchedAt: Date.now(), data };
64 writeFileSync(path, JSON.stringify(entry), "utf-8");
65 } catch {
66 // Cache writes are opportunistic. A read-only home directory or sandboxed
67 // environment should not make the registry appear unreachable.
68 }
69}
70
71// ── Fetchers ────────────────────────────────────────────────────────────────
72

Callers 2

fetchRegistryManifestFunction · 0.85
fetchItemManifestFunction · 0.85

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected