MCPcopy
hub / github.com/desktop/desktop / readOptionalPackageJSON

Function readOptionalPackageJSON

script/licenses/license-overrides.ts:20–28  ·  view source on GitHub ↗
(
  packageName: string
)

Source from the content-addressed store, hash-verified

18 JSON.parse(readFileSync(getPackageJSONPath(packageName), 'utf8'))
19
20const readOptionalPackageJSON = (
21 packageName: string
22): IPackageJSON | undefined => {
23 const packageJSONPath = getPackageJSONPath(packageName)
24
25 return existsSync(packageJSONPath)
26 ? JSON.parse(readFileSync(packageJSONPath, 'utf8'))
27 : undefined
28}
29
30const copilotCLIPkg = readPackageJSON('@github/copilot')
31const copilotCLILicense = `GitHub Copilot CLI License

Callers 1

Calls 2

getPackageJSONPathFunction · 0.85
parseMethod · 0.65

Tested by

no test coverage detected