pretty-redis
pretty-redis
is a cli client for redis, which is beautiful and very simple.
$ npm i -g pretty-redis
pretty-redis@0.1.0-alpha $ pretty-redis -h 127.0.0.1 -p 6379 --help, -h redis host name--port, -p redis port number--auth, -a redis auth key--plugin Node.js module name or file path
Usage
You can use pretty-redis
as redis-cli
in most cases:
› keys * › set key value › get key
It will only prettify json format. If you want to prettify other language/type, you can specify the language/type by using --lang
option:
› get html --lang=html
It's already better then redis-cli
but not pretty enough. So use highlight
(alias: hl
, hicat
) filter to make it even better:
› get html --lang=html | hl
The list of supported options and filters is available in wiki.
REPL
› keys * --repl js › var fs = require; js › // `data` - redis result js › js › data = data.map; js › js › var content = JSON.stringify; js › fs.writeFileSync;
Node.js
The bare minimum for using pretty-redis
on Node.js is requiring the module and create a PrettyRedis
instance and calling #exec(command)
to execute a command:
var PrettyRedis = ;var client = ; // connect to localhost:6379 client ;
Use plugins
pretty-redis
provides several plugins.
var plugins = PrettyRedisplugins; client;client;// and so on
Custom filter
client;
License
(The MIT License)