react-native-caches

A react native lib to provide cache size and clear cache feature.

Usage no npm install needed!

<script type="module">
  import reactNativeCaches from 'https://cdn.skypack.dev/react-native-caches';
</script>

README

react-native-caches

A package to get cache size and clear caches.

Installation

yarn add react-native-caches

Usage

import Caches from 'react-native-caches'

const fetchInfo = async () => {
  const info = await Caches.getCacheSize()
  console.log('fetchInfo', info)
  setCacheSize(info.cacheSize)
  setCacheUnit(info.unit)
}

const clearCache = async () => {
  await Caches.runClearCache()
  await fetchInfo()
}

TODO

  • Add android support
  • Add ios support