New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

adonis-redis

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adonis-redis

AdonisJs official redis provider to make working with redis fun and simple.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
67
-9.46%
Maintainers
1
Weekly downloads
 
Created
Source

AdonisJS Framework

Gitter Trello Version Build Status Coverage Status Downloads License

:pray: This is an official AdonisJs redis provider to make your life easier when working with Redis.

Redis provider makes it easier for you to work with redis and has out of the box support for Pub/Sub.

  • Installation
  • Setup

Installation

npm i --save adonis-redis

Setup

Once you have installed the provider from the npm, make sure to follow the below steps to setup the provider.

bootstrap/app.js
const providers = [
  ...,
  'adonis-redis/providers/RedisFactory',
  'adonis-redis/providers/Redis'
]

Redis Factory is a layer on top of IoRedis and Redis provider is something you are going to make use of. So setup an alias for that.

bootstrap/app.js
const aliases = {
  ...,
  Redis: 'Adonis/Addons/Redis'
}

Now you are free to make use of Redis anywhere in your application. Make sure to check official docs for same Redis Documentation.

Redis Config

You have to save the configuration for redis inside config/redis.js file. You can define multiple connections inside this file and specify the main connection under the connection property.

module.exports = {
  connection: 'redis',
  
  redis: {
    port: 6379,          // Redis port
    host: '127.0.0.1',   // Redis host
    family: 4,           // 4 (IPv4) or 6 (IPv6)
    password: 'auth',
    db: 0
  },
  
  redisAlternate: {
    port: 6380,          // Redis port
    host: '127.0.0.1',   // Redis host
    family: 4,           // 4 (IPv4) or 6 (IPv6)
    password: 'auth',
    db: 0
  }

}

Cluster Config

module.exports = {
  connection: 'redis',

  redis: {
    clusters: [
      {
        port: 6380,
        host: '127.0.0.1'
      },
      {
        port: 6381,
        host: '127.0.0.1'      
      }
    ],
    redisOptions: {}
  }
}

Keywords

redis

FAQs

Package last updated on 26 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts