MCPcopy
hub / github.com/ionic-team/capacitor / getCapacitorPackage

Function getCapacitorPackage

cli/src/common.ts:226–234  ·  view source on GitHub ↗
(config: Config, name: string)

Source from the content-addressed store, hash-verified

224}
225
226export async function getCapacitorPackage(config: Config, name: string): Promise<PackageJson | null> {
227 const packagePath = resolveNode(config.app.rootDir, `@capacitor/${name}`, 'package.json');
228
229 if (!packagePath) {
230 return null;
231 }
232
233 return readJSON(packagePath);
234}
235
236export async function requireCapacitorPackage(config: Config, name: string): Promise<PackageJson> {
237 const pkg = await getCapacitorPackage(config, name);

Callers 2

checkCapacitorPlatformFunction · 0.85
requireCapacitorPackageFunction · 0.85

Calls 2

resolveNodeFunction · 0.90
readJSONFunction · 0.85

Tested by

no test coverage detected