A library that stores JSON objects in Redis hashes without losing type information, using a flatten/unflatten approach. Current stable version is 6.0.3, with active development. It handles nested objects, arrays, and custom types via stringifier/parser options. Compared to directly storing JSON strings, it allows partial updates and field-level retrieval. Requires ioredis as a peer dependency. Ships TypeScript definitions.
npm install redis-jsonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic instantiation with ioredis, set/get operations, and clearing all keys.
Review array handling logic in your app; previously arrays were merged.
Avoid calling `clearAll()` frequently; consider alternative TTL-based cleanup.
Do not wrap `get` or `clearAll` in a multi/exec block; use them separately.
Replace `clearAll()` with a custom cleanup using Redis `scan` and `del`, or set TTL on keys.
Update custom stringifiers/parsers to return appropriate types (string for stringifier, value for parser).
Use an ioredis client instead of node-redis or other clients.
Use get outside transaction block.