Home / Function/ searchForPackageRoot() — astro Function Reference

searchForPackageRoot() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7740c3c3_0d00_7505_8dda_d4a010921894["searchForPackageRoot()"]
  f146dc60_74d2_b1d6_cb66_a8216ff4ea82["searchRoot.ts"]
  7740c3c3_0d00_7505_8dda_d4a010921894 -->|defined in| f146dc60_74d2_b1d6_cb66_a8216ff4ea82
  d8111c96_abe6_3306_3d6d_efb817cc311e["searchForWorkspaceRoot()"]
  d8111c96_abe6_3306_3d6d_efb817cc311e -->|calls| 7740c3c3_0d00_7505_8dda_d4a010921894
  03773237_bce4_1529_7edb_048ca1a7a255["hasPackageJSON()"]
  7740c3c3_0d00_7505_8dda_d4a010921894 -->|calls| 03773237_bce4_1529_7edb_048ca1a7a255
  style 7740c3c3_0d00_7505_8dda_d4a010921894 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/vercel/src/lib/searchRoot.ts lines 78–86

function searchForPackageRoot(current: string, root = current): string {
	if (hasPackageJSON(current)) return current;

	const dir = dirname(current);
	// reach the fs root
	if (!dir || dir === current) return root;

	return searchForPackageRoot(dir, root);
}

Domain

Subdomains

Frequently Asked Questions

What does searchForPackageRoot() do?
searchForPackageRoot() is a function in the astro codebase, defined in packages/integrations/vercel/src/lib/searchRoot.ts.
Where is searchForPackageRoot() defined?
searchForPackageRoot() is defined in packages/integrations/vercel/src/lib/searchRoot.ts at line 78.
What does searchForPackageRoot() call?
searchForPackageRoot() calls 1 function(s): hasPackageJSON.
What calls searchForPackageRoot()?
searchForPackageRoot() is called by 1 function(s): searchForWorkspaceRoot.

Analyze Your Own Codebase

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

Try Supermodel Free