0.0.3 • Published 10 months ago

capacitor-cache-file v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

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; }>
ParamType
options{ url: string; }

Returns: Promise<{ base64: string | null; }>


downloadAndCache(...)

downloadAndCache(options: { url: string; }) => Promise<{ base64: string; }>
ParamType
options{ url: string; }

Returns: Promise<{ base64: string; }>