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
  c7bf3ebc_1d4b_a382_4d8c_9503895e3f2c["getPackageVersion()"]
  db40ee65_f3fe_93a2_8502_7d805d2a1d6d["package-version.ts"]
  c7bf3ebc_1d4b_a382_4d8c_9503895e3f2c -->|defined in| db40ee65_f3fe_93a2_8502_7d805d2a1d6d
  8286c5ed_881e_5293_80e9_2e0f23c252d0["resolveJsId()"]
  c7bf3ebc_1d4b_a382_4d8c_9503895e3f2c -->|calls| 8286c5ed_881e_5293_80e9_2e0f23c252d0
  style c7bf3ebc_1d4b_a382_4d8c_9503895e3f2c 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
  }
}

Subdomains

Frequently Asked Questions

What does getPackageVersion() do?
getPackageVersion() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/utils/package-version.ts.
Where is getPackageVersion() defined?
getPackageVersion() is defined in packages/@tailwindcss-upgrade/src/utils/package-version.ts at line 9.
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