Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mono-js/mono-redis
Redis module for Mono
https://github.com/mono-js/mono-redis
mono mono-module redis
Last synced: 11 days ago
JSON representation
Redis module for Mono
- Host: GitHub
- URL: https://github.com/mono-js/mono-redis
- Owner: mono-js
- License: mit
- Created: 2017-09-27T13:47:57.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T23:23:04.000Z (over 6 years ago)
- Last Synced: 2024-09-25T21:44:17.579Z (about 2 months ago)
- Topics: mono, mono-module, redis
- Language: JavaScript
- Homepage:
- Size: 274 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> Redis module for [Mono](https://github.com/terrajs/mono)
[![npm version](https://img.shields.io/npm/v/mono-redis.svg)](https://www.npmjs.com/package/mono-redis)
[![Travis](https://img.shields.io/travis/terrajs/mono-redis/master.svg)](https://travis-ci.org/terrajs/mono-redis)
[![Coverage](https://img.shields.io/codecov/c/github/terrajs/mono-redis/master.svg)](https://codecov.io/gh/terrajs/mono-redis.js)
[![license](https://img.shields.io/github/license/terrajs/mono-redis.svg)](https://github.com/terrajs/mono-redis/blob/master/LICENSE)## Installation
```bash
npm install --save mono-redis
```Then, in your configuration file of your Mono application (example: `conf/application.js`):
```js
module.exports = {
mono: {
modules: ['mono-redis']
}
}
```## Configuration
Mono-Redis will use the `redis` property of your configuration (example: `conf/development.js`):
```js
module.exports = {
mono: {
redis: {
port: 8047,
// See [options] of https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
}
}
}
```## Usage
In your modules files, you can access `redis` instance like this:
```js
const { redis } = require('mono-redis')await redis.set('hello', 'world!')
const hello = await redis.get('hello')
// hello = 'world!'
```We are using [ioredis](https://github.com/luin/ioredis) as a client since it supports async/await promises.