# redis-shard

> A consistent hashing library for redis in node

Latest version **0.3.0** (published 2015-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-shard
pnpm add redis-shard
yarn add redis-shard
bun add redis-shard
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2015-10-16 |
| First published | 2013-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Ben Lindsey |
| Maintainers | blindsey |

## Links

- npm: https://www.npmjs.com/package/redis-shard
- Repository: https://github.com/blindsey/node-redis-shard
- Issues: https://github.com/blindsey/node-redis-shard/issues
- npm.io page: https://npm.io/package/redis-shard

## Dependencies (3)

- [step](https://npm.io/package/step.md) 0.0.6
- [redis](https://npm.io/package/redis.md) ^2.1.0
- [hashring](https://npm.io/package/hashring.md) ^3.2.0

## Recent versions

- 0.3.0 (latest) — 2015-10-16
- 0.2.0 — 2014-07-23
- 0.1.0 — 2014-06-27
- 0.0.1 — 2013-01-25

## README

redis-shard
===========

A consistent sharding library for redis in node

    $ npm install redis-shard

    var RedisShard = require('redis-shard');
    var options = { servers: [ '127.0.0.1:6379', '127.0.0.1:6479' ], database : 1, password : 'redis4pulseLocker' };
    var redis = new RedisShard(options);

    // SINGLE
    redis.set('foo', 'bar', console.log);
    redis.get('foo', console.log);

    // MULTI
    var multi = redis.multi();
    multi.set('foo', 'bar').set('bah', 'baz').expire('foo', 3600).expire('bah', 3600);
    multi.exec(console.log);

Options
-------

The constructor accepts an object containing the following options:

- `servers` (required) - An array of Redis servers (e.g. `'127.0.0.1:6379'`) to connect to
- `database` - Redis database to select
- `password` - Password for authentication
- `clientOptions` - Options object to be passed to each Redis client

---
_Source: https://npm.io/package/redis-shard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
