Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/cap / readManifest

Function: readManifest()

readManifest(capDir): CommerceAppManifest

Defined in: packages/b2c-tooling-sdk/src/operations/cap/install.ts:204

Reads and parses the commerce-app.json manifest file from a CAP directory.

Parameters

capDir

string

Path to the CAP directory containing commerce-app.json

Returns

CommerceAppManifest

Parsed manifest object

Throws

Error if commerce-app.json does not exist in the directory

Throws

Error if commerce-app.json is not valid JSON

Example

typescript
const manifest = readManifest('./my-commerce-app');
console.log(`App: ${manifest.id}@${manifest.version}`);

Released under the Apache-2.0 License.