Skip to content
View as Markdown
View as Markdown

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

Function: readManifestFromTarget()

readManifestFromTarget(target): Promise<CommerceAppManifest>

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

Reads the commerce-app.json manifest from a CAP directory or zip file without uploading or installing anything.

Useful for inspecting manifest fields (e.g. provider) before installing.

Parameters

target

string

Path to a CAP directory or .zip file

Returns

Promise<CommerceAppManifest>

Parsed manifest object

Throws

Error if the target does not exist or is not a directory/.zip file

Example

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

Released under the Apache-2.0 License.