import { Script } from "https://deno.land/x/upstash_redis@v1.19.1/pkg/script.ts";
Creates a new script.
Scripts offer the ability to optimistically try to execute a script without having to send the entire script to the server. If the script is loaded on the server, it tries again by sending the entire script. Afterwards, the script is cached on the server.
Examples
Example 1
Example 1
const redis = new Redis({...})
const script = redis.createScript<string>("return ARGV[1];")
const arg1 = await script.eval([], ["Hello World"])
assertEquals(arg1, "Hello World")
Constructors
new
Script(redis: Redis, script: string)