Node.js package to encode a sequence of Redis commands into Redis protocol, suitable for mass insertion.
Adapted from redis-mass.
npm install -g redis-protocol-cli
$ redis-protocol /path/to/input-file | redis-cli --pipe
# Or
$ cat /path/to/input-file | redis-protocol | redis-cli --pipe
$ redis-protocol /path/to/input-file
$ redis-protocol /path/to/input-file -o /path/to/output-file
Input file (Redis Commands)
SET key1 value1
SADD key2 value1 "value2" "value3"
ZADD "key3" 1 "value3"
Output (Redis Protocol)
*3
$3
SET
$4
key1
$6
value1
*5
$4
SADD
$4
key2
$6
value1
$6
value2
$6
value3
*4
$4
ZADD
$4
key3
$1
1
$6
value3