MCPcopy Index your code
hub / github.com/github/docs / readCompressedJsonFile

Function readCompressedJsonFile

lib/read-json-file.js:8–13  ·  view source on GitHub ↗
(xpath)

Source from the content-addressed store, hash-verified

6}
7
8export function readCompressedJsonFile(xpath) {
9 if (!xpath.endsWith('.br')) {
10 xpath += '.br'
11 }
12 return JSON.parse(brotliDecompressSync(fs.readFileSync(xpath)))
13}
14
15// Ask it to read a `foo.json` file and it will automatically
16// first see if there's a `foo.json.br` and only if it's not,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected