generated at
deno-redis
概要
deno-redisはDenoRedisクライアントです

基本
connect() 関数でRedisサーバへ接続できます
接続に成功すると、 Redis オブジェクトを返却します
typescript
import { connect } from "https://deno.land/x/redis@v0.11.1/mod.ts"; // v0.11.1の部分は適宜変えてください const redis = await connect({ hostname: "127.0.0.1", port: 6379 }); console.log(await redis.get("test"));

APIについて
基本的に Redis オブジェクトのメソッドとRedisコマンドは1:1で対応しています
ioredis同様、ほとんどのメソッドは Promise を返却するよう設計されています🙆

Pub/Sub
typescript
const subscription = await redis.subscribe("channel"); (async () => { for await (const { channel, message } of subscription.receive()) { handleMessage(message); } })();