{"id":46123,"library":"redis-kv-store","title":"redis-kv-store","description":"A simple Redis-based key/value store with an API identical to memory-kv-store, designed for Node.js >=24.14.0. Version 6.0.2 is current, ESM-only, and ships TypeScript types. It depends on a simple-redis-service instance for Redis connectivity. The library is lightweight, focused on minimal abstraction, and intended for use in Node.js server environments.","status":"active","version":"6.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/nfroidure/redis-kv-store","tags":["javascript","redis","knifecycle","typescript"],"install":[{"cmd":"npm install redis-kv-store","lang":"bash","label":"npm"},{"cmd":"yarn add redis-kv-store","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-kv-store","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to provide a Redis client instance","package":"simple-redis-service","optional":false}],"imports":[{"note":"ESM-only since v6; CommonJS require() will fail.","wrong":"const initRedisKV = require('redis-kv-store')","symbol":"initRedisKV","correct":"import initRedisKV from 'redis-kv-store'"},{"note":"TypeScript type exported; use type import to avoid runtime issues.","symbol":"RedisKVService","correct":"import type { RedisKVService } from 'redis-kv-store'"},{"note":"In ESM context, default export is initRedisKV; named destructuring from CJS is wrong.","wrong":"const { initRedisKV } = require('redis-kv-store')","symbol":"initRedisKV","correct":"const initRedisKV = (await import('redis-kv-store')).default"}],"quickstart":{"code":"import initRedisService from 'simple-redis-service';\nimport initRedisKV from 'redis-kv-store';\n\nconst redis = await initRedisService({\n  REDIS: {\n    host: process.env.REDIS_HOST ?? 'localhost',\n    port: Number(process.env.REDIS_PORT ?? 6379),\n  },\n  ENV: process.env,\n  log: console.log.bind(console),\n});\n\nconst redisKV = await initRedisKV({\n  redis,\n  log: console.log.bind(console),\n});\n\nawait redisKV.set('greeting', 'Hello, world!');\nconst value = await redisKV.get('greeting');\nconsole.log(value); // 'Hello, world!'\n\nawait redisKV.del('greeting');\nconst gone = await redisKV.get('greeting');\nconsole.log(gone); // undefined","lang":"typescript","description":"Initializes a Redis service and creates a key-value store, sets and retrieves a value, then deletes it."},"warnings":[{"fix":"Migrate to ESM by using 'import' syntax or dynamic import(). For Node.js, enable 'type': 'module' in package.json or use .mjs extension.","message":"Version 6.0.0+ dropped support for CommonJS (require()). Only ESM imports (import) are supported.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Upgrade Node.js to version 24.14.0 or higher.","message":"Node.js version requirement raised to >=24.14.0. Older Node versions will fail to load the module.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Always provide a valid log function, e.g., 'console.log.bind(console)' or a custom logger.","message":"The library expects the redis service's log function to be passed explicitly; forgetting to provide it may cause runtime errors or silent failures.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap your Redis client with 'simple-redis-service' before passing it to initRedisKV.","message":"The 'redis' service injected must be a 'simple-redis-service' instance; using a raw ioredis or redis client will break because the API shape differs.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use initRedisKV() factory instead of 'new RedisKVStore()'.","message":"Deprecated in v5: the constructor-style usage was removed. Only the factory function initRedisKV is supported.","severity":"deprecated","affected_versions":">=5.0.0 <6.0.0"}],"env_vars":null,"search_vec":"'24.14.0':24 '6.0.2':26 'abstract':55 'api':14 'base':9 'connect':47 'current':28 'depend':37 'design':21 'environ':63 'esm':30 'esm-on':29 'focus':52 'ident':15 'instanc':44 'intend':57 'javascript':64 'key/value':10 'knifecycl':66 'kv':3,19 'librari':49 'lightweight':51 'memori':18 'memory-kv-stor':17 'minim':54 'node.js':23,61 'redi':2,8,42,46,65 'redis-bas':7 'redis-kv-stor':1 'server':62 'servic':43 'ship':33 'simpl':6,41 'simple-redis-servic':40 'store':4,11,20 'type':35 'typescript':34,67 'use':59 'version':25","created_at":"2026-06-07T12:58:23.491860+00:00","updated_at":"2026-06-07T12:58:23.491860+00:00","problems":[{"fix":"Switch to import syntax or dynamic import(). If you must use require(), downgrade to v5 (not recommended).","cause":"Using require() on an ESM-only module (v6+).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/redis-kv-store/index.js from /path/to/project/app.js not supported."},{"fix":"Use 'await initRedisKV({...})' or '.then()' to get the actual service instance.","cause":"initRedisKV was called without 'await' or the returned promise was not resolved.","error":"TypeError: redisKV.get is not a function"},{"fix":"Ensure you pass a valid simple-redis-service instance, not a raw Redis client.","cause":"The injected 'redis' object does not match the expected simple-redis-service interface.","error":"TypeError: services.redis 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/nfroidure/redis-kv-store#readme","github":"https://github.com/nfroidure/redis-kv-store","docs":null,"changelog":null,"pypi":null,"npm":"redis-kv-store","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","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}}