Home / Function/ hasPackageJSON() — vite Function Reference

hasPackageJSON() — vite Function Reference

Architecture documentation for the hasPackageJSON() function in searchRoot.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  ca54fbf3_09b8_dc78_d456_909bca286809["hasPackageJSON()"]
  497939be_63aa_81b3_3492_3f2698d33097["searchRoot.ts"]
  ca54fbf3_09b8_dc78_d456_909bca286809 -->|defined in| 497939be_63aa_81b3_3492_3f2698d33097
  abbcb31f_2732_cc49_32a8_c121af61546c["searchForPackageRoot()"]
  abbcb31f_2732_cc49_32a8_c121af61546c -->|calls| ca54fbf3_09b8_dc78_d456_909bca286809
  style ca54fbf3_09b8_dc78_d456_909bca286809 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/searchRoot.ts lines 42–45

function hasPackageJSON(root: string) {
  const path = join(root, 'package.json')
  return fs.existsSync(path)
}

Domain

Subdomains

Frequently Asked Questions

What does hasPackageJSON() do?
hasPackageJSON() is a function in the vite codebase, defined in packages/vite/src/node/server/searchRoot.ts.
Where is hasPackageJSON() defined?
hasPackageJSON() is defined in packages/vite/src/node/server/searchRoot.ts at line 42.
What calls hasPackageJSON()?
hasPackageJSON() is called by 1 function(s): searchForPackageRoot.

Analyze Your Own Codebase

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

Try Supermodel Free