11.6.1 • Published 4 days ago

lite-ts-cache v11.6.1

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
4 days ago

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;
const getModifyOnFunc: (key: string) => Promise<number>;
const setModifyOnAction: (key: string, modifyOn: number) => Promise<void>
// 检测缓存是否变更的间隔区间, 默认: [5_000, 60_000]
const checkModifyIntervalRange: [number, number];
const cache = new CacheMemoey(nowTime, getModifyOnFunc, setModifyOnAction, checkModifyIntervalRange);
11.6.0

4 days ago

11.6.1

4 days ago

11.5.0

6 months ago

3.5.0

11 months ago

3.4.0

12 months ago

3.3.0

12 months ago

3.2.0

12 months ago

3.1.0

1 year ago

3.0.0

1 year ago