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
  a9a3f876_1870_b56c_a1a1_adc3de661d5a["getPackageVersionSync()"]
  0f4b2aca_6ae5_ec90_f7db_7b345b730686["package-version.ts"]
  a9a3f876_1870_b56c_a1a1_adc3de661d5a -->|defined in| 0f4b2aca_6ae5_ec90_f7db_7b345b730686
  17195868_a4f7_9a24_2405_8f8060a5f09a["cache()"]
  17195868_a4f7_9a24_2405_8f8060a5f09a -->|calls| a9a3f876_1870_b56c_a1a1_adc3de661d5a
  382c823e_93e7_43e9_c9aa_1dc8c7d46b17["resolveJsId()"]
  a9a3f876_1870_b56c_a1a1_adc3de661d5a -->|calls| 382c823e_93e7_43e9_c9aa_1dc8c7d46b17
  style a9a3f876_1870_b56c_a1a1_adc3de661d5a 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