Home / Function/ getPackageVersionSync() — tailwindcss Function Reference

getPackageVersionSync() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  de3714a2_211f_a4e9_f8b7_4a8dd2f45374["getPackageVersionSync()"]
  db40ee65_f3fe_93a2_8502_7d805d2a1d6d["package-version.ts"]
  de3714a2_211f_a4e9_f8b7_4a8dd2f45374 -->|defined in| db40ee65_f3fe_93a2_8502_7d805d2a1d6d
  3c4ec747_d0cc_59b6_8c68_55245af61c6c["cache()"]
  3c4ec747_d0cc_59b6_8c68_55245af61c6c -->|calls| de3714a2_211f_a4e9_f8b7_4a8dd2f45374
  8286c5ed_881e_5293_80e9_2e0f23c252d0["resolveJsId()"]
  de3714a2_211f_a4e9_f8b7_4a8dd2f45374 -->|calls| 8286c5ed_881e_5293_80e9_2e0f23c252d0
  style de3714a2_211f_a4e9_f8b7_4a8dd2f45374 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/utils/package-version.ts lines 20–29

export function getPackageVersionSync(pkg: string, base: string): string | null {
  try {
    let packageJson = resolveJsId(`${pkg}/package.json`, base)
    if (!packageJson) return null
    let { version } = JSON.parse(readFileSync(packageJson, 'utf8'))
    return version
  } catch {
    return null
  }
}

Subdomains

Called By

Frequently Asked Questions

What does getPackageVersionSync() do?
getPackageVersionSync() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/utils/package-version.ts.
Where is getPackageVersionSync() defined?
getPackageVersionSync() is defined in packages/@tailwindcss-upgrade/src/utils/package-version.ts at line 20.
What does getPackageVersionSync() call?
getPackageVersionSync() calls 1 function(s): resolveJsId.
What calls getPackageVersionSync()?
getPackageVersionSync() is called by 1 function(s): cache.

Analyze Your Own Codebase

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

Try Supermodel Free