Socket
Book a DemoInstallSign in
Socket

@trigo/atrix-redis

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

@trigo/atrix-redis

Redis integration into atrix microservice framework

unpublished
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
6
200%
Maintainers
3
Weekly downloads
 
Created
Source

atrix-redis

redis plugin for atrix microservice framework

atrix redis plugin automaticaly sets up the connection to your redis server using ioredis library

Compatibility

atrix-redis < 1.0.0 works with atrix < 6.0.0 atrix-redis >= 1.0.0 works with atrix >= 6.0.0

Features

  • configuration driven
  • multi connection/database mgmt

Installation

# install atrix framework
npm install -S @trigo/atrix

# install atrix-redis plugin
npm install -S @trigo/atrix-redis

# No need to install redis itself!

Usage & Configuration

handlers/GET.js

module.exports = (req, reply, service) => async {
	// access model class for connection "m1"
	const redisClient = service.dataConnections.m1.client;
	await redisClient.set(key, value);
	
	...
}

index.js

'use strict';

const atrix = require('@trigo/atrix');
const path = require('path');

atrix.addService({
	name: 'redis', 
	endpoints: {
		http: {
			// declare port to bind
      port: 3007,

      // the directory containing the handler files
      handlerDir: `${__dirname}/handlers`,
   	},
  },
	// declare a dataSource config section
	dataSource: {
		// name of the data source
		m1: {
			// type of data connection
			type: 'redis',
			// connection configuration
			config: {
				// redis host
				host: 'localhost',

				// redis port
				port: 6379,

				// optional: password
				password: 'redis-secret-password',

				// optional: db to user
				db: 1
			},
		},
		m2: {
			type: 'redis',
			config: {
				host: 'redis',
				port: 6379,
			},
		},
	},
});

// start service. 
// This will wait for the mongo connection to be available before starting up. 
// When conection(s) is lost after initial startup the plugin automatically tries to reconnect  
svc.start();

Run service with node index.js

FAQs

Package last updated on 24 Nov 2025

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