Redis®
@zugriff/redis
This package is part of the zugriff ecosystem. It runs on both Edge Runtimes using the fetch API and your machine using the fetch API or the ioredis package.
Usage
npm i --save @zugriff/redisCreating a client
import { Redis } from '@zugriff/redis';
const client = new Redis( process.env.ZUGRIFF_REDIS_TOKEN || { host: 'localhost', port: 6379, });Executing a command
await client.cmd('SET', 'number', 1); // { anchor: 'id', data: 'OK' }await client.cmd('SET', 'json', { hello: 'world' }); // { anchor: 'id', data: 'OK' }Querying for a value
const value1 = await client.cmd<number>('GET', 'number'); // { anchor: 'id', data: 1 }const value2 = await client.cmd<{ hello: string }>('GET', 'json'); // { anchor: 'id', data: { hello: 'world' } }Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd.