feature: vor und nachteile

This commit is contained in:
Hikyu
2026-05-31 13:54:31 +02:00
parent 552a947a1c
commit e3dad17446
23270 changed files with 3024794 additions and 200 deletions
+30
View File
@@ -0,0 +1,30 @@
'use strict';
const fs = require('node:fs');
const path = require('node:path');
const process = require('node:process');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
const process__default = /*#__PURE__*/_interopDefaultCompat(process);
function getPackageJSON(ctx) {
const cwd = ctx?.cwd ?? process__default.cwd();
const path$1 = path.resolve(cwd, "package.json");
if (fs__default.existsSync(path$1)) {
try {
const raw = fs__default.readFileSync(path$1, "utf-8");
const data = JSON.parse(raw);
return data;
} catch (e) {
if (!ctx?.programmatic) {
console.warn("Failed to parse package.json");
process__default.exit(1);
}
throw e;
}
}
}
exports.getPackageJSON = getPackageJSON;