const result = await redis.eval("fb67a0c03b48ddbf8b4c9b011e779563bdbc28cb", [], ["hello"]);
console.log(result) // "hello"

EVALSHA is like EVAL but instead of sending the script over the wire every time, you reference the script by its SHA1 hash. This is useful for caching scripts on the server side.

Arguments

sha
string
required
The sha1 hash of the script.
keys
string[]
required
All of the keys accessed in the script
args
unknown[]
required
All of the arguments you passed to the script

Response

The result of the script.

const result = await redis.eval("fb67a0c03b48ddbf8b4c9b011e779563bdbc28cb", [], ["hello"]);
console.log(result) // "hello"