edgeport - v1.0.6
    Preparing search index...

    Function encodeCommand

    • Encodes a command as a RESP array of bulk strings.

      Strings are UTF-8 encoded and numbers stringified, so encodeCommand(['SET', 'k', 1]) and encodeCommand(['SET', 'k', '1']) are the same bytes. Byte arguments pass through untouched, which is what keeps values binary-safe.

      Parameters

      • args: readonly RedisArg[]

        The command name followed by its arguments.

      Returns Uint8Array

      The encoded command frame.

      If args is empty.

      1.0.6

      import { encodeCommand } from 'edgeport/redis';

      encodeCommand(['LLEN', 'mylist']); // *2\r\n$4\r\nLLEN\r\n$6\r\nmylist\r\n