fkg
v1.1.2
Published
Read and set memory key!
Downloads
30
Readme
Quickstart
====================
To Create cache service...
======================================
1. Install
npm install fkg
2. Create server
const fkg = require('fkg');
const db = fkg({
dir:'D:\\work', //数据储存位置,为空时不进行存储
key:'exgeg2233', //key不为空时,储存的数据会被加密
db:['user','name'] //db必须存在,且必须为数组
});
3. Create user data
const data = {name:'xxx'};
db.user.add('id_1',data); //数据储存在本地
db.user.set('id_2',data); //数据储存在缓存
5. Get user data
db.user.list(); //获取user表缓存和本地数据键值
6. Get list data
db.user.get('id_1'); //获取user表中指定缓存
db.user.get('id_2'); //获取不到缓存,会获取本地数据
7. Delete user data
db.user.clear(); //清空user表中所有的缓存
db.user.kill(); //清空user表中所有的本地数据
db.user.del('id_1'); //删除user表中指定缓存和本地数据