Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/upstash_redis/pkg/commands/mod.ts>Command

HTTP based Redis Client for Serverless and Edge Functions
Go to Latest
class Command
Re-export
import { Command } from "https://deno.land/x/upstash_redis@v1.23.2/pkg/commands/mod.ts";

Command offers default (de)serialization and the exec method to all commands.

TData represents what the user will enter or receive, TResult is the raw data returned from upstash, which may need to be transformed or parsed.

Constructors

new
Command(command: (
| string
| boolean
| number
| unknown
)[]
, opts?: CommandOptions<TResult, TData>
)

Create a new command instance.

You can define a custom deserialize function. By default we try to deserialize as json.

Type Parameters

TResult
TData

Properties

readonly
command: (string | number | boolean)[]
readonly
deserialize: Deserialize<TResult, TData>
readonly
serialize: Serialize

Methods

exec(client: Requester): Promise<TData>

Execute the command using a client.