"use strict";
const path = require('path');
const fs = require('fs');
const cache = {};
/**
 * Works identically to require('/path/to/file.json'), but safer.
 */
function requireJson(pkgJsonPath, opts) {
    opts = opts || { ignoreCache: false };
    pkgJsonPath = path.resolve(pkgJsonPath);
    if (!opts.ignoreCache && cache[pkgJsonPath])
        return cache[pkgJsonPath];
    cache[pkgJsonPath] = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
    return cache[pkgJsonPath];
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = requireJson;
//# sourceMappingURL=requireJson.js.map