bob-the-bundler
Version:
Bob The Bundler!
19 lines (18 loc) • 708 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRootPackageJSON = void 0;
const tslib_1 = require("tslib");
const globby_1 = tslib_1.__importDefault(require("globby"));
const fse = tslib_1.__importStar(require("fs-extra"));
async function getRootPackageJSON(cwd) {
const [rootPackageJSONPath] = await (0, globby_1.default)("package.json", {
cwd,
absolute: true,
});
if (rootPackageJSONPath === undefined) {
throw new Error("Must be executed within a (monorepo-)package root.");
}
const rootPackageJSON = await fse.readJSON(rootPackageJSONPath);
return rootPackageJSON;
}
exports.getRootPackageJSON = getRootPackageJSON;