Connects, runs a single command, and closes.
The one-shot for a Worker that touches Redis once per request. Use connect when several commands share a connection.
Connection options plus the command to run.
The command's reply.
If the server rejects the credentials.
If the connection cannot be established.
If the server replies with an error.
1.0.6
import { command } from 'edgeport/redis';const reply = await command({ hostname: 'redis.example.com', password: env.REDIS_PASSWORD, args: ['GET', 'feature:flags']});const flags = reply.isNull ? {} : reply.json<Record<string, boolean>>(); Copy
import { command } from 'edgeport/redis';const reply = await command({ hostname: 'redis.example.com', password: env.REDIS_PASSWORD, args: ['GET', 'feature:flags']});const flags = reply.isNull ? {} : reply.json<Record<string, boolean>>();
Connects, runs a single command, and closes.
The one-shot for a Worker that touches Redis once per request. Use connect when several commands share a connection.