Home / Function/ installWithNpm() — ui Function Reference

installWithNpm() — ui Function Reference

Architecture documentation for the installWithNpm() function in update-dependencies.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  247bc8b3_c66d_b25a_8708_d8709a57ba7d["installWithNpm()"]
  30cdaf3b_9156_5324_145d_5e18169a3338["update-dependencies.ts"]
  247bc8b3_c66d_b25a_8708_d8709a57ba7d -->|defined in| 30cdaf3b_9156_5324_145d_5e18169a3338
  58f7ab25_356a_4300_d977_fc3482b06561["installWithPackageManager()"]
  58f7ab25_356a_4300_d977_fc3482b06561 -->|calls| 247bc8b3_c66d_b25a_8708_d8709a57ba7d
  style 247bc8b3_c66d_b25a_8708_d8709a57ba7d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/updaters/update-dependencies.ts lines 137–158

async function installWithNpm(
  dependencies: string[],
  devDependencies: string[],
  cwd: string,
  flag?: string
) {
  if (dependencies.length) {
    await execa(
      "npm",
      ["install", ...(flag ? [`--${flag}`] : []), ...dependencies],
      { cwd }
    )
  }

  if (devDependencies.length) {
    await execa(
      "npm",
      ["install", ...(flag ? [`--${flag}`] : []), "-D", ...devDependencies],
      { cwd }
    )
  }
}

Subdomains

Frequently Asked Questions

What does installWithNpm() do?
installWithNpm() is a function in the ui codebase, defined in packages/shadcn/src/utils/updaters/update-dependencies.ts.
Where is installWithNpm() defined?
installWithNpm() is defined in packages/shadcn/src/utils/updaters/update-dependencies.ts at line 137.
What calls installWithNpm()?
installWithNpm() is called by 1 function(s): installWithPackageManager.

Analyze Your Own Codebase

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

Try Supermodel Free