Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/onesy-me/redis

Redis utils
https://github.com/onesy-me/redis

amaui api back-end backend js nodejs redis utils

Last synced: 10 days ago
JSON representation

Redis utils

Awesome Lists containing this project

README

        



onesy logo

onesy Redis


Redis



MIT license    
Production ready    
100% test cov    
Nodejs


Very simple code    
Modern code    
Junior friendly    
Typescript    
Made with :yellow_heart:


## Getting started

### Add

```sh
yarn add @onesy/redis
```

Add `redis` peer dependency.

```sh
yarn add redis
```

### Use

```javascript
import OnesyRedis from '@onesy/redis';
// Make if you wanna a config file and
// inside of it add all the process.env related props
import Config from './config';

// Make a new amqp instance
const onesyRedis = new OnesyRedis({
uri: Config.amqp.redis.uri
});

// Await for a client connection
await onesyRedis.client;

// Send to a queue
await onesyRedis.publish('a', 'a');
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

One time local setup

Install docker and docker-compose

- https://docs.docker.com/get-docker
- https://docs.docker.com/compose/install

Make docker containers

```sh
yarn docker
```

### Prod

Build

```sh
yarn build
```