【文件属性】:
文件名称:popular-cache:具有内置统计信息的内存 LRU 缓存
文件大小:9KB
文件格式:ZIP
更新时间:2021-07-10 15:49:47
JavaScript
流行缓存
具有简单统计和智能代理模式的内存中 LRU 缓存。
安装
npm install popular-cache --save
基本用法
var pcache = require('popular-cache');
cache = pcache({
maxSize: 500,
maxAge: 1000 * 60 * 60 // in millisecond
}),
smallCache = pcache(50); // or simply sets max size
// basic usage
cache.set("key", "value")
cache.get("key")
cache.del("key") // delete key
cache.size() // get size
cache.reset() // resets cache
cach
【文件预览】:
popular-cache-master
----lib()
--------item.js(530B)
--------cache.js(4KB)
--------proxy.js(2KB)
----LICENSE(1KB)
----test()
--------proxy.js(5KB)
--------statistics.js(3KB)
--------basic.js(3KB)
----README.md(4KB)
----.gitignore(12B)
----index.js(53B)
----package.json(466B)