A TypeScript-first localStorage caching library (v1.1.18) with support for sessionStorage, memory cache, and cookies. Provides timer-based expiration (seconds/minutes), promise-based and synchronous APIs. Lightweight and zero-dependency, primarily used in Chinese-speaking developer communities. Current version is stable but infrequently updated.
npm install imba-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic caching with sessionStorage (default) and localStorage using setCache, getCache, and delCache with expiration.
Use third argument as minutes or pass a string like 'ss', 'mm', 'hh' as fourth argument.
Avoid using setVariable; use setCache or setCacheLoca instead.
Always use library functions for both set and get to ensure proper serialization.
Run 'pnpm add imba-cache' or 'npm install imba-cache'
Use 'import { setCache } from 'imba-cache'' instead of 'import setCache from 'imba-cache''Check for null before using the result: const val = getCache('key'); if (val) { ... }No dependency data recorded yet.