redis-shard-api

A pure Javascript port version of Python's RedisShardAPI

redis-shard-api

A pure Javascript port version of Python's RedisShardAPI

npm install redis-shard-api

Simple example, include as example/client.js

var RedisShard = require('redis-shard-api');
 
var servers = [
  {'name':'node1','host':'127.0.0.1','port':6379,'db':0},
  {'name':'node2','host':'127.0.0.1','port':6380,'db':0},
  {'name':'node3','host':'127.0.0.1','port':6381,'db':0},
  {'name':'node4','host':'127.0.0.1','port':6382,'db':0}
];
 
var redis = new RedisShard(servers);
 
redis.set("test1", "1234");
 
redis.get("test1", function(errresult){
  console.log(result);
});
 

This will display:

1234