property

RedisClient.ReplyOptions.buffer

buffer: AsBuffer

Get the bulk and verbatim strings of the reply, at any depth, as Buffers instead of UTF-8 text. Redis sends stored values and stream IDs as bulk strings. Status replies such as "OK", integers, doubles, null and the cursor of a scan method do not change. The keys of an object are strings. If one is not UTF-8 text, the command rejects with ERR_ENCODING_INVALID_ENCODED_DATA, and error.reply has [key, value] pairs. In a transaction, that error is the result in the reply to EXEC.

await redis.hset("images", "logo", new Uint8Array([0xff, 0xd8]));
await redis.hget("images", "logo", { buffer: true }); // <Buffer ff d8>