{"id":44667,"library":"d2c-rcaches","title":"RCaches","description":"A lightweight Redis-based shared caching library for Node.js, version 1.4.1. Provides simple and efficient caching with TTL support, built on top of ioredis. Ships TypeScript types and requires Node 10+. Minimal API surface compared to alternatives like node-cache-manager.","status":"active","version":"1.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/enchantinggg4/rcaches","tags":["javascript","typescript"],"install":[{"cmd":"npm install d2c-rcaches","lang":"bash","label":"npm"},{"cmd":"yarn add d2c-rcaches","lang":"bash","label":"yarn"},{"cmd":"pnpm add d2c-rcaches","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Redis client dependency for cache operations","package":"ioredis","optional":false}],"imports":[{"note":"Default export; ESM and TypeScript supported.","wrong":"const RCaches = require('d2c-rcaches')","symbol":"default","correct":"import RCaches from 'd2c-rcaches'"},{"note":"Also available as named export for consistency.","wrong":"import RCaches from 'd2c-rcaches'","symbol":"RCaches","correct":"import { RCaches } from 'd2c-rcaches'"},{"note":"TypeScript type; exported as type.","wrong":"","symbol":"CacheOptions","correct":"import { CacheOptions } from 'd2c-rcaches'"}],"quickstart":{"code":"import RCaches from 'd2c-rcaches';\nimport Redis from 'ioredis';\n\nconst redis = new Redis({ host: process.env.REDIS_HOST ?? 'localhost', port: Number(process.env.REDIS_PORT ?? 6379) });\n\nconst cache = new RCaches(redis, { prefix: 'myapp:', ttl: 60 });\n\nasync function main() {\n  await cache.set('user:1', { name: 'Alice' });\n  const user = await cache.get('user:1');\n  console.log(user); // { name: 'Alice' }\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Creates a Redis-backed cache instance, sets and retrieves a value with TTL."},"warnings":[{"fix":"Always provide a unique prefix when multiple apps share the same Redis instance.","message":"Cache keys are prefixed automatically but prefix is optional; no default prefix can lead to key collisions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use numeric TTL values, e.g., ttl: 60.","message":"TTL is in seconds but may be passed as string; ensure numeric values to avoid unintended behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider forking or migrating to an actively maintained caching library.","message":"The package has not been updated in over 2 years; compatibility with newer Redis or Node versions is untested.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.4.1':13 '10':33 'altern':39 'api':35 'base':6 'built':22 'cach':8,18,43 'compar':37 'effici':17 'ioredi':26 'javascript':45 'librari':9 'lightweight':3 'like':40 'manag':44 'minim':34 'node':32,42 'node-cache-manag':41 'node.js':11 'provid':14 'rcach':1 'redi':5 'redis-bas':4 'requir':31 'share':7 'ship':27 'simpl':15 'support':21 'surfac':36 'top':24 'ttl':20 'type':29 'typescript':28,46 'version':12","created_at":"2026-06-07T12:51:15.303035+00:00","updated_at":"2026-06-07T12:51:15.303035+00:00","problems":[{"fix":"Run: npm install ioredis","cause":"Missing ioredis peer dependency.","error":"Error: Cannot find module 'ioredis'"},{"fix":"Use: const RCaches = require('d2c-rcaches').default;","cause":"Default import used incorrectly in CommonJS environment.","error":"TypeError: RCaches is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/enchantinggg4/rcaches#readme","github":"https://github.com/enchantinggg4/rcaches","docs":null,"changelog":null,"pypi":null,"npm":"d2c-rcaches","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}