Skip to main content
Module

x/r2d2/mod.ts>sendCommand

Fast, lightweight Redis client library for Deno.
Go to Latest
function sendCommand
import { sendCommand } from "https://deno.land/x/r2d2@v1.1.2/mod.ts";

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

Example:

import { sendCommand } from "https://deno.land/x/r2d2@$VERSION/mod.ts";

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
optional
raw = [UNSUPPORTED]

Returns

Promise<Reply>