redis-protocol-cli
v1.0.1
Published
Encodes redis commands into redis protocol
Downloads
4
Readme
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
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