@zugriff/redis
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@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/redis

Creating 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 a value

const value = await client.cmd<number>('GET', 'number'); // { anchor: 'id', data: 1 }
const value = await client.cmd<{ hello: string }>('GET', 'json'); // { anchor: 'id', data: { hello: 'world' } }

Package Sidebar

Install

npm i @zugriff/redis

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

16.4 kB

Total Files

8

Last publish

Collaborators

  • lucagoslar