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 npm@0.2.12-1
npm info using node@v0.3.3-pre
npm info preuninstall hiredis@0.1.5
npm info uninstall hiredis@0.1.5
npm info predeactivate hiredis@0.1.5
npm info deactivate hiredis@0.1.5
npm info postdeactivate hiredis@0.1.5
npm info postuninstall hiredis@0.1.5
npm info uninstall hiredis@0.1.5 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