Registry / storage / clhq-cache-module

clhq-cache-module

JSON →
library1.1.0-alpha.189jsnpmunverified

Redis-based caching module designed for NestJS applications in the Clippy stack. Current version 1.1.0-alpha.189, actively developed as an alpha release with frequent updates. It integrates with @nestjs/cache-manager and provides Redis operations with NestJS decorators. Differentiators include seamless integration with NestJS' dependency injection and support for health checks.

npm install clhq-cache-module
INSTALL
IMPORT
SIG · CLHQ-CACHE-MODULE
C
clhq-cache-module
storagejavascriptv1.1.0-alpha.189
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.

CacheModule
import { CacheModule } from 'clhq-cache-module'
const CacheModule = require('clhq-cache-module').CacheModule
ESM module; CommonJS require may not work with named exports in alpha version
RedisService
import { RedisService } from 'clhq-cache-module'
TypeScript types included; use named import
CacheModule
CacheModule.register({ isGlobal: true })
new CacheModule({ isGlobal: true })
Use static register method for module configuration

Demonstrates registering the CacheModule in NestJS app and using RedisService for basic set/get operations.

import { Module } from '@nestjs/common'; import { CacheModule, RedisService } from 'clhq-cache-module'; @Module({ imports: [ CacheModule.register({ isGlobal: true, redisUrl: process.env.REDIS_URL ?? 'redis://localhost:6379', }), ], }) export class AppModule {} // In a service: @Injectable() export class MyService { constructor(private readonly redisService: RedisService) {} async example() { await this.redisService.set('key', 'value', 60); const result = await this.redisService.get('key'); console.log(result); } }
Debug
Known issues
deprecatedAlpha version: API may change without notice. Avoid production use.
fix
Wait for stable release or pin to specific alpha version with thorough testing.
affects: <=1.1.0-alpha.189
gotchaRedis URL must include protocol (redis://) otherwise connection fails silently.
fix
Set REDIS_URL environment variable with 'redis://' prefix.
affects: >=1.0.0
breakingDropped support for NestJS <11; peer dep requires @nestjs/common >=11.0.0.
fix
Upgrade NestJS to v11 or higher.
affects: >=1.1.0-alpha.180
Errors
Common errors & fixes
Cannot find module 'clhq-cache-module' or its corresponding type declarations.
Package not installed or TypeScript strict mode fails due to missing types.
fix
npm install clhq-cache-module@1.1.0-alpha.189 and ensure 'skipLibCheck': false in tsconfig.
Error: Redis connection refused
Redis server not running or wrong connection string.
fix
Start Redis server locally or update REDIS_URL environment variable.
Upgrade
Version history
1.1.0-alpha.189latest on npm
Audit
Dependencies
@nestjs/commonrequiredPeer dependency: requires NestJS common >=11.0.0 for decorators and DI
Agent activity
28 hits · last 30 days
node
24
Bingbot
1
OpenAI (training)
1
Resources
clhq-cache-module — npm install clhq-cache-module · libregistry