Home / Function/ findExistingEnvFile() — ui Function Reference

findExistingEnvFile() — ui Function Reference

Architecture documentation for the findExistingEnvFile() function in env-helpers.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  1c137b43_b752_25b4_2fda_4972ce467a1b["findExistingEnvFile()"]
  6ea7c0f6_8e34_1742_bb2f_90e611bb6eda["env-helpers.ts"]
  1c137b43_b752_25b4_2fda_4972ce467a1b -->|defined in| 6ea7c0f6_8e34_1742_bb2f_90e611bb6eda
  style 1c137b43_b752_25b4_2fda_4972ce467a1b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/env-helpers.ts lines 13–29

export function findExistingEnvFile(targetDir: string) {
  const variants = [
    ".env.local",
    ".env",
    ".env.development.local",
    ".env.development",
  ]

  for (const variant of variants) {
    const filePath = path.join(targetDir, variant)
    if (existsSync(filePath)) {
      return filePath
    }
  }

  return null
}

Subdomains

Frequently Asked Questions

What does findExistingEnvFile() do?
findExistingEnvFile() is a function in the ui codebase, defined in packages/shadcn/src/utils/env-helpers.ts.
Where is findExistingEnvFile() defined?
findExistingEnvFile() is defined in packages/shadcn/src/utils/env-helpers.ts at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free