Skip to content

iuioiua/r2d2

This branch is up to date with main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0997910 · Feb 3, 2025
Dec 20, 2024
Feb 1, 2023
Apr 13, 2024
Feb 3, 2025
Jun 30, 2022
Feb 3, 2025
Oct 8, 2023
Feb 3, 2025
Feb 3, 2025
Feb 3, 2025
Feb 3, 2025

Repository files navigation

r2d2

JSR CI codecov

Minimal Redis client for Deno.

import { RedisClient } from "@iuioiua/r2d2";
import { assertEquals } from "@std/assert/equals";

using redisConn = await Deno.connect({ port: 6379 });
const redisClient = new RedisClient(redisConn);

const reply1 = await redisClient.sendCommand(["SET", "hello", "world"]);
assertEquals(reply1, "OK");

const reply2 = await redisClient.sendCommand(["GET", "hello"]);
assertEquals(reply2, "world");

Features

  • Supports RESPv2, RESP3, raw data, pipelining, pub/sub, transactions and Lua scripts.
  • Compatible with timeouts and retries.
  • One of the fastest Redis clients in Deno.
  • Written to be easily understood and debugged.
  • Encourages the use of actual Redis commands without intermediate abstractions.

Resources

Size comparison

Module Size (KB) Dependencies
r2d2 25.04 4
deno-redis 213.19 33
npm:ioredis 895.38 10
npm:redis 968.17 9

Recorded on December 20, 2024.

Note: Results were produced using deno info <module>