{"id":45601,"library":"nodecaf-redis","title":"Nodecaf Redis Wrapper","description":"A convenient wrapper around node-redis for use within a Nodecaf application, providing a promise-based async/await interface. Version 0.1.0 is the initial release, currently in development and not yet stable. It relies on the node-redis package and is tightly coupled with the Nodecaf framework. Compared to using node-redis directly, it simplifies configuration and integrates with Nodecaf's lifecycle, but it is not intended for general-purpose Redis access outside of Nodecaf.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","redis","nodecaf","async","await","promise"],"install":[{"cmd":"npm install nodecaf-redis","lang":"bash","label":"npm"},{"cmd":"yarn add nodecaf-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add nodecaf-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The underlying Redis client library; nodecaf-redis wraps its functionality.","package":"redis","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require will fail.","wrong":"const redis = require('nodecaf-redis');","symbol":"default","correct":"import redis from 'nodecaf-redis';"},{"note":"Named export for the class constructor, useful for TypeScript type annotations.","symbol":"NodecafRedis","correct":"import { NodecafRedis } from 'nodecaf-redis';"},{"note":"TypeScript users should import the type for strong typing.","symbol":"RedisClient","correct":"import type { RedisClient } from 'nodecaf-redis';"}],"quickstart":{"code":"import Redis from 'nodecaf-redis';\n\nconst redis = new Redis({\n  url: process.env.REDIS_URL ?? 'redis://localhost:6379'\n});\n\nawait redis.connect();\nawait redis.set('key', 'value');\nconst value = await redis.get('key');\nconsole.log(value);\nawait redis.disconnect();","lang":"typescript","description":"Demonstrates creating a Redis client instance, connecting, setting and getting a value, and disconnecting."},"warnings":[{"fix":"Pin to exact version and test on upgrades.","message":"The package is in early development (v0.1.0) and the API may change without notice.","severity":"gotcha","affected_versions":"0.1.x"},{"fix":"Ensure your application is built on Nodecaf, or consider using node-redis directly.","message":"Must be used within a Nodecaf application; standalone usage may lack necessary context.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Switch to ESM by adding 'type': 'module' to your package.json, or use a different Redis wrapper.","message":"Requires Node.js >= 14 and ESM support; CJS projects cannot use this package.","severity":"breaking","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.0':25 'access':79 'applic':16 'around':7 'async':86 'async/await':22 'await':87 'base':21 'compar':53 'configur':62 'conveni':5 'coupl':48 'current':30 'develop':32 'direct':59 'framework':52 'general':76 'general-purpos':75 'initi':28 'integr':64 'intend':73 'interfac':23 'javascript':83 'lifecycl':68 'node':9,42,57 'node-redi':8,41,56 'nodecaf':1,15,51,66,82,85 'outsid':80 'packag':44 'promis':20,88 'promise-bas':19 'provid':17 'purpos':77 'redi':2,10,43,58,78,84 'releas':29 'reli':38 'simplifi':61 'stabl':36 'tight':47 'use':12,55 'version':24 'within':13 'wrapper':3,6 'yet':35","created_at":"2026-06-07T12:55:48.640069+00:00","updated_at":"2026-06-07T12:55:48.640069+00:00","problems":[{"fix":"Use import instead of require(), or convert your project to ESM.","cause":"Trying to require an ESM-only package in a CommonJS module.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/nodecaf-redis/src/index.js not supported."},{"fix":"Use 'import Redis from 'nodecaf-redis'' (default import).","cause":"Importing the default export incorrectly (e.g., using named import for default).","error":"TypeError: Redis is not a constructor"},{"fix":"Ensure redis variable is properly initialized with 'new Redis()' and not reassigned.","cause":"Calling redis.connect() before the client is instantiated or after it has been destroyed.","error":"TypeError: Cannot read properties of undefined (reading 'connect')"}],"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://gitlab.com/nodecaf/redis#README","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"nodecaf-redis","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}}