Home / File/ unstorage-fs-storage.ts — astro Source File

unstorage-fs-storage.ts — astro Source File

Architecture documentation for unstorage-fs-storage.ts, a typescript file in the astro codebase. 4 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  9c737e00_f257_960c_acda_37490a5dd6f2["unstorage-fs-storage.ts"]
  e92fda44_4a5d_b83b_1a45_958cdae6c91b["./definitions.js"]
  9c737e00_f257_960c_acda_37490a5dd6f2 --> e92fda44_4a5d_b83b_1a45_958cdae6c91b
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  9c737e00_f257_960c_acda_37490a5dd6f2 --> d9a92db9_c95e_9165_13ac_24b3d859d946
  a56f5589_e3c3_ced2_bdd4_5ad39a3cb093["unstorage"]
  9c737e00_f257_960c_acda_37490a5dd6f2 --> a56f5589_e3c3_ced2_bdd4_5ad39a3cb093
  dc5292a8_21c2_d173_fec5_2c7c281b14c5["fs-lite"]
  9c737e00_f257_960c_acda_37490a5dd6f2 --> dc5292a8_21c2_d173_fec5_2c7c281b14c5
  style 9c737e00_f257_960c_acda_37490a5dd6f2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { fileURLToPath } from 'node:url';
import * as unstorage from 'unstorage';
import fsLiteDriver from 'unstorage/drivers/fs-lite';
import type { Storage } from '../definitions.js';

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

Subdomains

Dependencies

  • ./definitions.js
  • fs-lite
  • node:url
  • unstorage

Frequently Asked Questions

What does unstorage-fs-storage.ts do?
unstorage-fs-storage.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What does unstorage-fs-storage.ts depend on?
unstorage-fs-storage.ts imports 4 module(s): ./definitions.js, fs-lite, node:url, unstorage.
Where is unstorage-fs-storage.ts in the architecture?
unstorage-fs-storage.ts is located at packages/astro/src/assets/fonts/infra/unstorage-fs-storage.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/assets/fonts/infra).

Analyze Your Own Codebase

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

Try Supermodel Free