Home / Function/ getPackageVersion() — tailwindcss Function Reference

getPackageVersion() — tailwindcss Function Reference

Architecture documentation for the getPackageVersion() function in package-version.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  65b55bca_918d_7580_9635_cd151fcd6ea5["getPackageVersion()"]
  b450167c_267d_f5f1_2949_2913d41a5259["resolveJsId()"]
  65b55bca_918d_7580_9635_cd151fcd6ea5 -->|calls| b450167c_267d_f5f1_2949_2913d41a5259
  style 65b55bca_918d_7580_9635_cd151fcd6ea5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/utils/package-version.ts lines 9–18

export async function getPackageVersion(pkg: string, base: string): Promise<string | null> {
  try {
    let packageJson = resolveJsId(`${pkg}/package.json`, base)
    if (!packageJson) return null
    let { version } = JSON.parse(await fs.readFile(packageJson, 'utf8'))
    return version
  } catch {
    return null
  }
}

Domain

Subdomains

Frequently Asked Questions

What does getPackageVersion() do?
getPackageVersion() is a function in the tailwindcss codebase.
What does getPackageVersion() call?
getPackageVersion() calls 1 function(s): resolveJsId.

Analyze Your Own Codebase

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

Try Supermodel Free