An async cache manager for React Native, version 1.2.0. It wraps @react-native-community/async-storage to provide a simple API for caching serializable data with TTL and attempt-based invalidation. The library offers predefined TTL constants (e.g., TTL_12H) and methods like get, set, getAll, clear, clearExpired, and clearByRegex. It is lightweight and focused on React Native, unlike general-purpose cache libraries such as node-cache or lru-cache which are not async or storage-backed. Last updated in 2019; maintenance status is unclear.
npm install react-native-cachemereNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: get cached data, fetch if missing, then cache with TTL and attempt count.
Install @react-native-community/async-storage and link it according to your React Native version.
Consider migrating to a maintained alternative like react-native-mmkv or async-storage wrappers.
Ensure data is JSON-serializable. Use JSON.stringify/parse if needed.
Always check for `null` and handle accordingly.
Use a specific regex to avoid unintended data loss.
npm install @react-native-community/async-storage
import Cache from 'react-native-cachemere' (without curly braces)
Ensure data is a plain serializable object.