Last active
August 29, 2015 14:04
-
-
Save poying/b825fac57a88a59614ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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