Home / Class/ UnstorageFsStorage Class — astro Architecture

UnstorageFsStorage Class — astro Architecture

Architecture documentation for the UnstorageFsStorage class in unstorage-fs-storage.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  c121036f_95d0_5514_6eed_d1fb284ec99f["UnstorageFsStorage"]
  9c737e00_f257_960c_acda_37490a5dd6f2["unstorage-fs-storage.ts"]
  c121036f_95d0_5514_6eed_d1fb284ec99f -->|defined in| 9c737e00_f257_960c_acda_37490a5dd6f2
  da441b37_7362_45b9_a4d9_6bd0222d0837["constructor()"]
  c121036f_95d0_5514_6eed_d1fb284ec99f -->|method| da441b37_7362_45b9_a4d9_6bd0222d0837
  432e4333_3841_d1ee_8869_09d3d3f4188c["getItem()"]
  c121036f_95d0_5514_6eed_d1fb284ec99f -->|method| 432e4333_3841_d1ee_8869_09d3d3f4188c
  2b2b0a9d_3657_155a_684d_d072e73c56c2["getItemRaw()"]
  c121036f_95d0_5514_6eed_d1fb284ec99f -->|method| 2b2b0a9d_3657_155a_684d_d072e73c56c2
  53f48a24_f8ad_cb52_a1a8_2320bbe6e127["setItem()"]
  c121036f_95d0_5514_6eed_d1fb284ec99f -->|method| 53f48a24_f8ad_cb52_a1a8_2320bbe6e127
  66a9e5c7_3d90_26ab_876d_eaa3cfae00bd["setItemRaw()"]
  c121036f_95d0_5514_6eed_d1fb284ec99f -->|method| 66a9e5c7_3d90_26ab_876d_eaa3cfae00bd

Relationship Graph

Source Code

packages/astro/src/assets/fonts/infra/unstorage-fs-storage.ts lines 6–30

export class UnstorageFsStorage implements Storage {
	readonly #unstorage: unstorage.Storage;

	constructor({ base }: { base: URL }) {
		this.#unstorage = unstorage.createStorage({
			driver: fsLiteDriver({ base: fileURLToPath(base) }),
		});
	}

	async getItem(key: string): Promise<any | null> {
		return await this.#unstorage.getItem(key);
	}

	async getItemRaw(key: string): Promise<Buffer | null> {
		return await this.#unstorage.getItemRaw(key);
	}

	async setItem(key: string, value: any): Promise<void> {
		return await this.#unstorage.setItem(key, value);
	}

	async setItemRaw(key: string, value: any): Promise<void> {
		return await this.#unstorage.setItemRaw(key, value);
	}
}

Domain

Frequently Asked Questions

What is the UnstorageFsStorage class?
UnstorageFsStorage is a class in the astro codebase, defined in packages/astro/src/assets/fonts/infra/unstorage-fs-storage.ts.
Where is UnstorageFsStorage defined?
UnstorageFsStorage is defined in packages/astro/src/assets/fonts/infra/unstorage-fs-storage.ts at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free