MCPcopy Create free account
hub / github.com/BCsabaEngine/svelteesp32 / parsePackageJson

Function parsePackageJson

src/commandLine.ts:207–216  ·  view source on GitHub ↗
(packageJsonPath: string)

Source from the content-addressed store, hash-verified

205}
206
207function parsePackageJson(packageJsonPath: string): Record<string, unknown> {
208 try {
209 const content = readFileSync(packageJsonPath, 'utf8');
210 return JSON.parse(content);
211 } catch (error) {
212 throw new Error(`Failed to parse package.json at ${packageJsonPath}: ${(error as Error).message}`, {
213 cause: error
214 });
215 }
216}
217
218function getNpmPackageVariable(packageJson: Record<string, unknown>, variableName: string): string | undefined {
219 const prefix = '$npm_package_';

Callers 1

interpolateNpmVariablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected