mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-14 19:23:28 +08:00
14 lines
371 B
JavaScript
14 lines
371 B
JavaScript
import { readFileSync } from "node:fs";
|
|
import { resolve, dirname } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
export function resolvePath(url, ...parts) {
|
|
return resolve(dirname(fileURLToPath(url)), ...parts);
|
|
}
|
|
|
|
export function getPackageMeta() {
|
|
return JSON.parse(
|
|
readFileSync(resolvePath(import.meta.url, "../package.json"), "utf8")
|
|
);
|
|
}
|