UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

15 lines (14 loc) 459 B
import { relinka } from "@reliverse/relinka"; import { readPackageJSON } from "pkg-types"; const pkgInfo = { name: "unknown", version: "0.0.0" }; readPackageJSON().then((pkg) => { pkgInfo.name = pkg.name || "unknown"; pkgInfo.version = pkg.version || "0.0.0"; }).catch(() => { relinka("warn", "Could not read package.json, using default values"); }); export const getPkgName = () => pkgInfo.name; export const getPkgVersion = () => pkgInfo.version;