@les3dev/capacitor-bundle-path
v1.0.0
Published
Retrieve the file system path to a bundled asset, or undefined if the asset is not found
Readme
@les3dev/capacitor-bundle-path
Retrieve the file system path to a bundled asset, or undefined if the asset is not found.
Install
npm
npm install @les3dev/capacitor-bundle-path npx cap sync
pnpm
pnpm add @les3dev/capacitor-bundle-path pnpm exec cap sync
bun
bun add @les3dev/capacitor-bundle-path bunx cap sync
API
get_path(...)
get_path(options: { path: string; }) => any| Param | Type |
| ------------- | ------------------------------ |
| options | { path: string; } |
Returns: any
Usage
import { BundlePath } from '@les3dev/capacitor-bundle-path';
const result = await BundlePath.get_path({ path: 'assets/myfile.json' });
if (result.path) {
console.log('Native path:', result.path);
} else {
console.warn('Asset not found');
}