MCPcopy
hub / github.com/wdjungst/react-project / getPackageJSON

Function getPackageJSON

modules/PackageUtils.js:9–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7export const pkgPath = path.join(APP_PATH, 'package.json')
8
9export function getPackageJSON() {
10 if (!fs.existsSync(pkgPath))
11 logNoPackageJSON()
12 let packageJSON
13 try {
14 packageJSON = require(pkgPath)
15 } catch(e) {
16 logCantReadPackageJSON()
17 }
18 return packageJSON
19}
20
21export function getDXConfig() {
22 const packageJSON = getPackageJSON()

Callers 2

checkDependenciesFunction · 0.90
getDXConfigFunction · 0.85

Calls 2

logNoPackageJSONFunction · 0.85
logCantReadPackageJSONFunction · 0.85

Tested by

no test coverage detected