capacitor-cache-file
v0.0.3
Published
A Capacitor plugin that enables caching of files of any type. It checks if a file is already cached and returns it if available; otherwise, it downloads the file, saves it to the cache, and returns the path to the saved file. The plugin also prevents dupl
Downloads
2
Maintainers
Readme
capacitor-cache-file
A Capacitor plugin that enables caching of files of any type. It checks if a file is already cached and returns it if available; otherwise, it downloads the file, saves it to the cache, and returns the path to the saved file. The plugin also prevents duplication when the same URL is requested multiple times.
For usage instructions, see:
Install
npm install capacitor-cache-file
npx cap sync
API
checkCache(...)
checkCache(options: { url: string; }) => Promise<{ base64: string | null; }>
| Param | Type |
| ------------- | ----------------------------- |
| options
| { url: string; } |
Returns: Promise<{ base64: string | null; }>
downloadAndCache(...)
downloadAndCache(options: { url: string; }) => Promise<{ base64: string; }>
| Param | Type |
| ------------- | ----------------------------- |
| options
| { url: string; } |
Returns: Promise<{ base64: string; }>