@zero-scripts/core
Version:
Framework for creating presets, configurations and extensions
14 lines • 495 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.readJson = void 0;
const fs_1 = require("fs");
const _cache = {};
function readJson(_path, selector) {
const realPath = fs_1.realpathSync(_path);
if (!_cache[realPath]) {
_cache[realPath] = JSON.parse(fs_1.readFileSync(realPath, 'utf8'));
}
return selector ? selector(_cache[realPath]) : _cache[realPath];
}
exports.readJson = readJson;
//# sourceMappingURL=readJson.js.map