MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / readPackageJson

Function readPackageJson

src/cli/init.ts:21–31  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

19}
20
21export function readPackageJson(dirPath: string): PackageJson {
22 const packageJsonPath = join(dirPath, "package.json");
23 if (existsSync(packageJsonPath)) {
24 try {
25 return JSON.parse(readFileSync(packageJsonPath, "utf-8"));
26 } catch (e) {
27 // Ignore package.json parsing errors
28 }
29 }
30 return {};
31}
32
33export function getDefaultAuthorName(packageData: PackageJson): string {
34 if (typeof packageData.author === "string") {

Callers 2

init.test.tsFile · 0.85
initExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…