A TypeScript utility for creating Redis keys with type-safe template literals (v1.0.1, stable). Supports nested configuration objects to define reusable Redis key templates with parameters, using TypeScript's template literal types (requires TS 4.1+). Provides three usage modes: a static map via createRedisKeysMap(), a dynamic key object, and direct string templates. Key differentiator: full type safety with parameter autocompletion and compile-time validation of required and optional parameters. Lightweight, zero dependencies, ships TypeScript types.
npm install create-redis-keyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates two ways to create Redis keys: with createRedisKeysMap for reusable templates and direct template string.
Add 'as const' after the object literal: createRedisKeysMap({ key: 'template' } as const)Ensure every %ParamName% in the template has a corresponding key in the params object.
Use createRedisKeysMap() or direct string templates instead.
Use proper import: import { createRedisKeysMap } from 'create-redis-key';Pass a single template string, not an array.
No dependency data recorded yet.