# redis-multi-server

> This module was designed to mange multiple redis servers and do not let you think how information and on witch server is stored. Module will choose the server with more free information and memory

Latest version **1.0.0** (published 2021-12-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install redis-multi-server
pnpm add redis-multi-server
yarn add redis-multi-server
bun add redis-multi-server
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-12-11 |
| First published | 2021-12-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Armen Hakobyan |
| Maintainers | inorainllc |
| Keywords | redis, multiple, node, node-redis, js |

## Links

- npm: https://www.npmjs.com/package/redis-multi-server
- npm.io page: https://npm.io/package/redis-multi-server

## Dependencies (1)

- [redis](https://npm.io/package/redis.md) ^4.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-12-11

## README

<h1> Redis servers controller <h1>

<pre>npm install redis-multi-server</pre>

<h3>
    This module was designed to mange multiple redis servers and do not let you think how information and on witch server is stored.
    Module will choose the server with more free information and memory.
</h3>

<hr>

<h1>Install redis on your server  with docker</h1>

<code>

docker run -d -h redis -e REDIS_PASSWORD=pass -v redis-data:/data -p 5020:6379 --name redis --restart always redis:5.0.5-alpine3.9 /bin/sh -c 'redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}'

</code>


<h1>USAGE</h1>

```javascript
    const RC = require("redis-multi-server");

    let redis_list = [

        {
            name: "REDIS 1",
            username: "",
            password: "my_secure_password",
            host: "myredis1.com",
            port: 5020,
        },
        {
            name: "REDIS 2",
            username: "",
            password: "my_secure_password2",
            host: "myredis2.com",
            port: 5021
        },

    ]

    let rc = new RC(redis_list,{
        onAllConnected : async ()=>{
             
             //Save information to redis server
             await rc.set("a", "MyInfo");

             //Save information to custom redis server
             await rc.set("test", "MyInfo2", "TIVIMIVI");

             //Get saved information from redis
             await rc.get("b");

             //Get saved information from redis
             await rc.remove("b");
        }
    })
```

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