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
  e008c554_f7a9_9ac2_a33f_17769dc44155["getPackageVersion()"]
  f29a95c9_1a7d_1f94_04ba_9a97869b9a02["resolveJsId()"]
  e008c554_f7a9_9ac2_a33f_17769dc44155 -->|calls| f29a95c9_1a7d_1f94_04ba_9a97869b9a02
  style e008c554_f7a9_9ac2_a33f_17769dc44155 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