mono-redis

2.0.1 • Public • Published

Mono

Redis module for Mono

npm version Travis Coverage license

Installation

npm install --save mono-redis

Then, in your configuration file of your Mono application (example: conf/application.js):

module.exports = {
  mono: {
    modules: ['mono-redis']
  }
}

Configuration

Mono-Redis will use the redis property of your configuration (example: conf/development.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:

const { redis } = require('mono-redis')
 
await redis.set('hello', 'world!')
const hello = await redis.get('hello')
// hello = 'world!'

We are using ioredis as a client since it supports async/await promises.

Readme

Keywords

Package Sidebar

Install

npm i mono-redis

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

4.65 kB

Total Files

4

Last publish

Collaborators

  • atinux
  • benjamincanac
  • gaetansenn