Home / Function/ store() — astro Function Reference

store() — astro Function Reference

Architecture documentation for the store() function in store.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  d894cc72_af05_8a28_ccd1_f0e9c968d4a1["store()"]
  545e9f22_8ccd_6843_90f2_ff38e9751de3["PreferenceStore"]
  d894cc72_af05_8a28_ccd1_f0e9c968d4a1 -->|defined in| 545e9f22_8ccd_6843_90f2_ff38e9751de3
  1778b2ce_672d_cdaf_e4ff_ce16ef0a36d7["write()"]
  d894cc72_af05_8a28_ccd1_f0e9c968d4a1 -->|calls| 1778b2ce_672d_cdaf_e4ff_ce16ef0a36d7
  style d894cc72_af05_8a28_ccd1_f0e9c968d4a1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/preferences/store.ts lines 18–30

	private get store(): Record<string, any> {
		if (this._store) return this._store;
		if (fs.existsSync(this.file)) {
			try {
				this._store = JSON.parse(fs.readFileSync(this.file).toString());
			} catch {}
		}
		if (!this._store) {
			this._store = {};
			this.write();
		}
		return this._store;
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does store() do?
store() is a function in the astro codebase, defined in packages/astro/src/preferences/store.ts.
Where is store() defined?
store() is defined in packages/astro/src/preferences/store.ts at line 18.
What does store() call?
store() calls 1 function(s): write.

Analyze Your Own Codebase

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

Try Supermodel Free