{"id":44518,"library":"cachetree-redis","title":"cachetree-redis","description":"Redis storage backend for Cachetree, a caching library. Version 3.0.0 provides an adapter that connects Redis to Cachetree's tree-based caching system. It wraps the redis npm client and handles serialization, database selection, and authentication. This package is specifically for Cachetree users who want a Redis store; it is not a general-purpose Redis client. Release cadence is low; maintained as part of the Cachetree ecosystem.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/davidwood/cachetree-redis","tags":["javascript","cache","tree","cachetree","redis"],"install":[{"cmd":"npm install cachetree-redis","lang":"bash","label":"npm"},{"cmd":"yarn add cachetree-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add cachetree-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core cache tree library required; this adapter is designed to be used with Cachetree instances.","package":"cachetree","optional":false},{"reason":"Underlying Redis client for database communication.","package":"redis","optional":false}],"imports":[{"note":"CommonJS module only; ESM imports are not supported.","wrong":"import cachetreeRedis from 'cachetree-redis';","symbol":"default","correct":"var cachetreeRedis = require('cachetree-redis');"},{"note":"Do not use 'new' keyword. The exported function returns a store instance.","wrong":"var store = new cachetreeRedis();","symbol":"constructor","correct":"var store = cachetreeRedis({ host: 'localhost', port: 6379 });"},{"note":"The underlying Redis client is exposed as a property, not a method.","wrong":"store.getClient()","symbol":"client property","correct":"store.client"}],"quickstart":{"code":"var cachetreeRedis = require('cachetree-redis');\nvar cachetree = require('cachetree');\nvar store = cachetreeRedis({ host: 'localhost', port: 6379 });\nvar cache = cachetree(store);\ncache.set('foo', 'bar', function(err) {\n  if (err) console.error(err);\n  else cache.get('foo', function(err, value) {\n    console.log(value); // 'bar'\n  });\n});","lang":"javascript","description":"Create a Cachetree instance with a Redis backend, set and get a value."},"warnings":[{"fix":"Eliminate port/host/options when using a pre-created client.","message":"Redis client options are passed to redis.createClient; if you provide a custom 'client' option, all other connection options are ignored.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a single password option to avoid confusion.","message":"The 'pw' option for password can also be specified as 'pass' or 'password'; only one is used if both provided.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set autoCast: false in options if you need to store raw values.","message":"autoCast defaults to true, meaning all values are JSON.stringify'd and JSON.parse'd. This can cause issues with binary data or non-serializable objects.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Select database on the client before passing it in.","message":"Database selection via 'db' or 'database' is ignored if a custom 'client' is provided.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check redis version requirements; consider pinning redis to v2.x.","message":"The redis npm package v3+ changes its API; this adapter may require updates for compatibility.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.0.0':13 'adapt':16 'authent':40 'backend':6 'base':25 'cach':10,26,74 'cachetre':2,8,21,46,71,76 'cachetree-redi':1 'cadenc':63 'client':33,61 'connect':18 'databas':37 'ecosystem':72 'general':58 'general-purpos':57 'handl':35 'javascript':73 'librari':11 'low':65 'maintain':66 'npm':32 'packag':42 'part':68 'provid':14 'purpos':59 'redi':3,4,19,31,51,60,77 'releas':62 'select':38 'serial':36 'specif':44 'storag':5 'store':52 'system':27 'tree':24,75 'tree-bas':23 'user':47 'version':12 'want':49 'wrap':29","created_at":"2026-06-07T12:50:31.546402+00:00","updated_at":"2026-06-07T12:50:31.546402+00:00","problems":[{"fix":"Ensure 'var cachetree = require('cachetree');' and that cachetree exports a constructor.","cause":"Forgot to require cachetree, or Cachetree version mismatch.","error":"TypeError: cachetree is not a function"},{"fix":"Start Redis server or provide correct host/port in options.","cause":"Redis server not running or incorrect host/port.","error":"Redis connection error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED"},{"fix":"Use store.client.get directly; it is the underlying Redis client.","cause":"Using store.client as if it were a direct Redis client; it is the store's client property but may be wrapped.","error":"TypeError: store.client.get is not a function"}],"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/davidwood/cachetree-redis#readme","github":"ssh://git@github.com/davidwood/cachetree-redis","docs":null,"changelog":null,"pypi":null,"npm":"cachetree-redis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","caching"],"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}}