1.4.10 • Published 3 years ago

fibjs_redis v1.4.10

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

fibjs_redis

fibjs redis

使用fibjs实现的Redis客户端。
支持 pipeline、mult/exec、pub/sub、script、以及redis4.0的api。
使用注意:以下情况禁止使用公共的Redis对象
1. block系列api(blpop...)会阻塞
2. mult/exec 这个api开启后其他Fiber调用命令也会乱入
3. sub系列 开启(p)subscribe后禁用大多数api方法了

npm -i fibjs_redis

typescript
import {Redis} from "fibjs_redis";

const Redis=require("fibjs_redis").Redis;
var r = new Redis();
console.log(r.ping());
r.set("hi","hello fibjs!", 1);
console.log(r.get("hi"));

r.set("anum",323);
console.log(typeof r.get("anum"));//string
console.log(typeof r.get("anum", Redis.castNumber));//number
console.log(typeof r.get("anum", Redis.castBigInt));//BigInt
console.log(typeof r.incr("anum"));//number
console.log(typeof r.incr("anum", Redis.castBigInt));//BigInt

redis-pipeline
var pipe = redis.pipeOpen();
pipe.set("foo","foo",3);
pipe.get("foo);
var arr = pipe.pipeSubmit();
console.log(typeof arr, ...arr);
//或者 var arr=redis.pipeline(pipe=>{
pipe.set("foo","foo",3);
pipe.get("foo);
});
console.log(typeof arr, ...arr);

redis-lua
console.log(redis.eval('return {KEYS1,ARGV1,KEYS2,ARGV2}','a','b','aa','bb'))

1.4.9

3 years ago

1.4.10

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.20

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago