File: connected-users-websocket/node_modules/socket.io/node_modules/redis/examples/simple.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   connected-users-websocket/node_modules/socket.io/node_modules/redis/examples/simple.js   Download  
File: connected-users-websocket/node_modules/socket.io/node_modules/redis/examples/simple.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 748 bytes
 

Contents

Class file image Download
var redis = require("redis"), client = redis.createClient(); client.on("error", function (err) { console.log("error event - " + 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) { if (err) { return console.error("error response - " + err); } console.log(replies.length + " replies:"); replies.forEach(function (reply, i) { console.log(" " + i + ": " + reply); }); }); client.quit(function (err, res) { console.log("Exiting from quit command."); });