Registry / database / hinos-redis

hinos-redis

JSON →
library2.0.5jsnpmunverified

Redis connection manager plugin for the hinos framework. Version 2.0.5 provides a simple decorator-based approach to manage multiple Redis connections. It uses TypeScript decorators for dependency injection of Redis instances into classes. The package wraps ioredis and exposes a subset of its API. Stable but niche, with monthly releases.

npm install hinos-redis
INSTALL
IMPORT
SIG · HINOS-REDIS
H
hinos-redis
databasejavascriptv2.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Redis
import { Redis } from 'hinos-redis'
const Redis = require('hinos-redis');
ESM default export is not available; use named import.
REDIS
import { REDIS } from 'hinos-redis'
import REDIS from 'hinos-redis';
REDIS is a decorator, must be named import.
RedisOptions
import { RedisOptions } from 'hinos-redis'
Type import for configuring the Redis connection options.

Shows how to configure and use hinos-redis with TypeScript decorator pattern.

import { Redis, REDIS } from 'hinos-redis'; // Initialize default connection Redis({ host: 'localhost', port: 6379 }); // Use decorator to inject redis instance class MyService { @REDIS() static redis: import('ioredis').Redis; static async store(key: string, value: any) { await this.redis.set(key, JSON.stringify(value), 'EX', 3600); } }
Debug
Known issues
breakingVersion 2.0.0 changed the decorator syntax from @Redis() to @REDIS()
fix
Update decorators to use @REDIS() instead of @Redis()
affects: <2.0.0
gotchaThe package does not export a default Redis instance; must use the decorator or create connections explicitly.
fix
Always use the Redis() function to initialize connections before using decorators.
affects: >=2.0.0
deprecatedThe ioredis dependency may have breaking changes; check compatibility with ioredis v5+
fix
Pin ioredis to version 4.x or use compatible version.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: redis.set is not a function
Called set method before initializing connection or wrong import
fix
Ensure Redis({...}) is called before using the decorator, and import REDIS as named.
Cannot find module 'hinos-redis'
Package not installed or import path incorrect
fix
Run 'npm install hinos-redis' and ensure import path is 'hinos-redis' not 'hinos/redis'.
Upgrade
Version history
2.0.5latest on npm
Audit
Dependencies
ioredisrequiredUnderlying Redis client library used for all operations
hinosoptionalDesigned as a plugin for the hinos framework; core dependency for decorator support
Agent activity
12 hits · last 30 days
node
12
Resources
hinos-redis — npm install hinos-redis · libregistry