2.0.3 • Published 8 years ago

xl-cache v2.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

#xl-cache nodejs文件缓存模块

使用方法

  • 添加缓存 set(key,value,duration);
    duration 过期时常,单位秒,不传或者传0时缓存不过期
cache.set('test1', 'xialei').then(function() {
//设置缓存成功
}).catch(function(e) {
//设置缓存失败		
});
  • 读取缓存
    get(key);
cache.get('test1').then(function(data) {
    console.log(data);
}).catch(function(e) {
});
  • 删除缓存
    remove(key);
cache.remove('test').then(function() {
//删除成功
}).catch(function(e) {
//删除失败
});
  • 清空缓存
    clean();
cache.clean().then(function() {
//清空成功
}).catch(function(e) {
//清空失败
});

#单元测试

npm run test
2.0.3

8 years ago

2.0.2

8 years ago

2.0.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago