1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Organize examples.

This commit is contained in:
Matt Ranney
2010-10-20 16:38:33 -07:00
parent 85bd648adc
commit 1c5f73f541
7 changed files with 6 additions and 1 deletions

17
examples/simple.js Normal file
View File

@@ -0,0 +1,17 @@
var redis = require("redis"),
client = redis.createClient();
client.on("error", function (err) {
console.log("Redis connection error to " + client.host + ":" + client.port + " - " + err);
});
client.set("string key", "string val", redis.print);
client.hset("hash key", "hashtest 1", "some value", redis.print);
client.hset(["hash key", "hashtest 2", "some other value"], redis.print);
client.hkeys("hash key", function (err, replies) {
console.log(replies.length + " replies:");
replies.forEach(function (reply, i) {
console.log(" " + i + ": " + reply);
});
client.quit();
});