Skip to content

Instantly share code, notes, and snippets.

@poying
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poying/b825fac57a88a59614ce to your computer and use it in GitHub Desktop.
Save poying/b825fac57a88a59614ce to your computer and use it in GitHub Desktop.
repl.on('line', function (line) {
prettyRedis.lock()
.then(prettyRedis.exec.bind(prettyRedis, line))
.then(prettyRedis.prettify)
.then(prettyRedis.print(' %s'))
.then(prettyRedis.unlock.bind(prettyRedis));
});
repl.on('error', function () {
// print error
prettyRedis.unlock();
});
var prettyRedis = require('pretty-redis');
var plugins = prettyRedis.plugins;
prettyRedis.use(plugins.keys);
prettyRedis.use(plugins.array);
prettyRedis.use(plugins.object);
prettyRedis.use(plugins.text([/* allowed */]));
prettyRedis.exec('get html')
.then(prettyRedis.prettify)
.then(prettyRedis.print('%s'));
prettyRedis.exec('keys *')
.then(prettyRedis.prettify)
.then(prettyRedis.print());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment