Home / Function/ storage() — astro Function Reference

storage() — astro Function Reference

Architecture documentation for the storage() function in cached-font-fetcher.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  f13528c3_0413_1df5_d9e5_f45828f576da["storage()"]
  767f384c_0dbf_0041_0eb2_69933f4c7602["CachedFontFetcher"]
  f13528c3_0413_1df5_d9e5_f45828f576da -->|defined in| 767f384c_0dbf_0041_0eb2_69933f4c7602
  style f13528c3_0413_1df5_d9e5_f45828f576da fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/infra/cached-font-fetcher.ts lines 25–33

	async #cache(storage: Storage, key: string, cb: () => Promise<Buffer>): Promise<Buffer> {
		const existing = await storage.getItemRaw(key);
		if (existing) {
			return existing;
		}
		const data = await cb();
		await storage.setItemRaw(key, data);
		return data;
	}

Domain

Subdomains

Frequently Asked Questions

What does storage() do?
storage() is a function in the astro codebase, defined in packages/astro/src/assets/fonts/infra/cached-font-fetcher.ts.
Where is storage() defined?
storage() is defined in packages/astro/src/assets/fonts/infra/cached-font-fetcher.ts at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free