redis-protocol
Node.js package to encode a sequence of Redis commands into Redis protocol, suitable for mass insertion.
Adapted from redis-mass.
Installation
npm install -g redis-protocol-cli
Usage
Mass insertion on Redis
$ redis-protocol /path/to/input-file | redis-cli --pipe
# Or
$ cat /path/to/input-file | redis-protocol | redis-cli --pipe
Output to console
$ redis-protocol /path/to/input-file
Output to file
$ redis-protocol /path/to/input-file -o /path/to/output-file
Examples
Redis Commands)
Input file (SET key1 value1
SADD key2 value1 "value2" "value3"
ZADD "key3" 1 "value3"
Redis Protocol)
Output (*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