{"id":46119,"library":"redis-key","title":"redis-key","description":"Redis key generator that joins arguments into a string with a configurable separator (default ':') and optional prefix. Version 1.3.0 is stable with no recent releases; it provides a concise alternative to manual array joining. Differentiator: minimal footprint — no dependencies, supports custom separator and prefix for consistent key namespacing.","status":"maintenance","version":"1.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/wankdanker/node-redis-key","tags":["javascript","redis","key","join","arguments"],"install":[{"cmd":"npm install redis-key","lang":"bash","label":"npm"},{"cmd":"yarn add redis-key","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-key","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a single function as default. Use default import or require with 'require('redis-key').default' if using ESM.","wrong":"const { redisKey } = require('redis-key')","symbol":"redis-key (default function)","correct":"import rk from 'redis-key'"},{"note":"defaults is a named export that configures separator and prefix globally.","wrong":"const defaults = require('redis-key').defaults","symbol":"defaults","correct":"import { defaults } from 'redis-key'"},{"note":"In CommonJS, the default export is the main function. Named destructuring will fail.","wrong":"const { rk } = require('redis-key')","symbol":"redis-key (CommonJS)","correct":"const rk = require('redis-key')"}],"quickstart":{"code":"import rk, { defaults } from 'redis-key';\n\n// Use default separator ':'\nconst key1 = rk('product-collection', 'company', 'price-level');\nconsole.log(key1); // 'product-collection:company:price-level'\n\n// Change separator and prefix\nconst config = defaults('/', 'app');\nconst key2 = config('user', 123);\nconsole.log(key2); // 'app/user/123'\n\n// Without prefix, just change separator\nconst rk2 = defaults('/');\nconst key3 = rk2('part', 1, 3);\nconsole.log(key3); // 'part/1/3'","lang":"typescript","description":"Shows importing the default function and the defaults export, using default separator, setting custom separator with prefix, and just custom separator."},"warnings":[{"fix":"Use the returned function for consistent separator/prefix instead of mixing rk() calls after defaults().","message":"Calling defaults() returns a new function but also mutates global state for subsequent plain rk() calls.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"If you need a prefix, use defaults() to create a new function or manually prepend the prefix in your key.","message":"Prefix is not applied when using the default export rk() — only when calling defaults().","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure all arguments are primitives (string, number) or explicitly convert to string.","message":"All arguments are coerced to strings — objects become '[object Object]', arrays become comma-separated.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using template literals or arrays.join(':') for zero-dependency solution.","message":"Package is in maintenance mode; no updates since 2015, but still works for simple use cases.","severity":"deprecated","affected_versions":"1.3.0"}],"env_vars":null,"search_vec":"'1.3.0':22 'altern':33 'argument':9,56 'array':36 'concis':32 'configur':15 'consist':49 'custom':44 'default':17 'depend':42 'differenti':38 'footprint':40 'generat':6 'javascript':52 'join':8,37,55 'key':3,5,50,54 'manual':35 'minim':39 'namespac':51 'option':19 'prefix':20,47 'provid':30 'recent':27 'redi':2,4,53 'redis-key':1 'releas':28 'separ':16,45 'stabl':24 'string':12 'support':43 'version':21","created_at":"2026-06-07T12:58:23.095393+00:00","updated_at":"2026-06-07T12:58:23.095393+00:00","problems":[{"fix":"Use: const rk = require('redis-key');  // CommonJS\n or import rk from 'redis-key';  // ESM","cause":"Importing as named export instead of default import in CommonJS or ESM.","error":"TypeError: rk is not a function"},{"fix":"Ensure you have called defaults() correctly and stored the returned function.","cause":"Calling rk() without arguments returns undefined if defaults() returned empty.","error":"TypeError: rk(...) is not a function"},{"fix":"Run: npm install redis-key","cause":"Package not installed or configured as external in bundler.","error":"Module not found: Can't resolve 'redis-key'"}],"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/wankdanker/node-redis-key#readme","github":"https://github.com/wankdanker/node-redis-key","docs":null,"changelog":null,"pypi":null,"npm":"redis-key","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"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}}