1.0.3 • Published 5 years ago

redis-lruk v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

redis-lruk

缓存算法(基于redis)

Build Status codecov npm

安装

npm i redis-lruk

使用

const LRUK = require('redis-lruk');
const config = {
  namespace: 'ns',
  queue: 3,
  cache: 3,
  k: 2
};
// 如果client是redis创建的,要调用decorate()方法; async-redis的则不用
const lru2 = new LRUK(client, config);
// 异步函数
lru2.record('word1|word2&word3 word4');

对象成员

  • client redis连接
  • config lruk配置
  • async record(string keywords) 处理复杂的输入再调用hit()
  • async hit(string word) 记录单个非空字符串数据
  • async top(number n) 查询前n
  • async reset(string word) 缓存高频数据
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago