lite-ts-cache
TypeScript icon, indicating that this package has built-in type declarations

11.7.2 • Public • Published

Version

代码

CacheBase - 缓存

const cache: CacheBase;

// 清理
await cache.flush('键');

// 获取
const res = await cache.get('键', async () => {
    // 加载数据
    return [];
});
// res = []

const res = await cache.getModifyOn('键');
// res = 缓存修改时间
  • MemoryCache - 内存缓存
const nowTime: NowTimeBase;
// 检测缓存是否变更的间隔区间, 默认: [5, 60]
const checkIntervalRange: [number, number];
const cache = new MemoryCache(nowTime, checkIntervalRange);

Readme

Keywords

Package Sidebar

Install

npm i lite-ts-cache

Weekly Downloads

0

Version

11.7.2

License

GPL-3.0

Unpacked Size

43.1 kB

Total Files

9

Last publish

Collaborators

  • ahl5esoft