Home / Function/ loadRemoteImage() — astro Function Reference

loadRemoteImage() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  0b5c99da_0bec_0e51_a67d_5cdfd26a1318["loadRemoteImage()"]
  6a8f5c45_bf5b_34c9_0e8c_3118f0ca359e["shared.ts"]
  0b5c99da_0bec_0e51_a67d_5cdfd26a1318 -->|defined in| 6a8f5c45_bf5b_34c9_0e8c_3118f0ca359e
  ed295512_d229_a4d2_b12b_c573504afd00["handleImageRequest()"]
  ed295512_d229_a4d2_b12b_c573504afd00 -->|calls| 0b5c99da_0bec_0e51_a67d_5cdfd26a1318
  style 0b5c99da_0bec_0e51_a67d_5cdfd26a1318 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/endpoint/shared.ts lines 9–21

export async function loadRemoteImage(src: URL): Promise<Buffer | undefined> {
	try {
		const res = await fetch(src);

		if (!res.ok) {
			return undefined;
		}

		return Buffer.from(await res.arrayBuffer());
	} catch {
		return undefined;
	}
}

Domain

Subdomains

Frequently Asked Questions

What does loadRemoteImage() do?
loadRemoteImage() is a function in the astro codebase, defined in packages/astro/src/assets/endpoint/shared.ts.
Where is loadRemoteImage() defined?
loadRemoteImage() is defined in packages/astro/src/assets/endpoint/shared.ts at line 9.
What calls loadRemoteImage()?
loadRemoteImage() is called by 1 function(s): handleImageRequest.

Analyze Your Own Codebase

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

Try Supermodel Free