Skip to main content
Module

x/r2d2/mod.ts>sendCommand

Lightweight Redis client library for Deno.
Go to Latest
function sendCommand
import { sendCommand } from "https://deno.land/x/r2d2@v0.0.11/mod.ts";

Sends a command to the Redis server and returns the parsed reply.

Example:

const redisConn = await Deno.connect({ port: 6379 });

// Returns "OK"
await sendCommand(redisConn, ["SET", "hello", "world"]);

// Returns "world"
await sendCommand(redisConn, ["GET", "hello"]);

Parameters

redisConn: Deno.Conn
command: Command

Returns

Promise<Reply>