Skip to content

Instantly share code, notes, and snippets.

@mranney
Created December 30, 2010 01:19
Show Gist options
  • Save mranney/759320 to your computer and use it in GitHub Desktop.
Save mranney/759320 to your computer and use it in GitHub Desktop.
var client = require("redis").createClient(),
util = require("util");
client.set("some key", "A value with Unicode: ☕");
client.get("some key", function (err, reply) {
// a wise user also checks for errors
console.log("Reply: " + reply);
});
client.hmset("hash key", "prop1", "val1", "prop2", "val2");
client.hgetall("hash key", function (err, res) {
console.log("Val: " + util.inspect(res));
client.quit();
});
rv-mjr2:~/work/node_redis (master)$ node example.js
Reply: A value with Unicode: ☕
Segmentation fault
rv-mjr2:~/work/node_redis (master)$ npm uninstall hiredis
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info predeactivate [email protected]
npm info deactivate [email protected]
npm info postdeactivate [email protected]
npm info postuninstall [email protected]
npm info uninstall [email protected] complete
npm ok
rv-mjr2:~/work/node_redis (master)$ node example.js
Reply: A value with Unicode: ☕
Val: { prop1: 'val1',
prop2: 'val2',
hashtest: 'should be a hash' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment