installedVersion
uses node:fs
import type { Layout } from "#codebase/tcmts/loader"; import fs from "node:fs"; import path from "node:path"; export const installedVersion = (lay: Layout, alias: string) => { try { return (JSON.parse(fs.readFileSync(path.join(lay.cacheDir, "node_modules", alias, "package.json"), "utf8")) as { version: string }).version; } catch { return undefined; } }