create-t3-app-deepmeta
Version:
Create web application with the t3 stack
13 lines (9 loc) • 367 B
text/typescript
import { type PackageJson } from "type-fest";
import path from "path";
import fs from "fs-extra";
import { PKG_ROOT } from "~/consts.js";
export const getVersion = () => {
const packageJsonPath = path.join(PKG_ROOT, "package.json");
const packageJsonContent = fs.readJSONSync(packageJsonPath) as PackageJson;
return packageJsonContent.version ?? "1.0.0";
};