MCPcopy Index your code
hub / github.com/ionic-team/capacitor / requireCapacitorPackage

Function requireCapacitorPackage

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

Source from the content-addressed store, hash-verified

234}
235
236export async function requireCapacitorPackage(config: Config, name: string): Promise<PackageJson> {
237 const pkg = await getCapacitorPackage(config, name);
238
239 if (!pkg) {
240 fatal(
241 `Unable to find node_modules/@capacitor/${name}.\n` +
242 `Are you sure ${c.strong(`@capacitor/${name}`)} is installed?`,
243 );
244 }
245 return pkg;
246}
247
248export async function getCapacitorPackageVersion(config: Config, platform: string): Promise<string> {
249 return (await requireCapacitorPackage(config, platform)).version;

Callers 1

Calls 2

fatalFunction · 0.90
getCapacitorPackageFunction · 0.85

Tested by

no test coverage detected