redisScan (v2.0.0) recursively iterates over all keys in a Redis instance using the recommended SCAN family of commands (SCAN, HSCAN, SSCAN, ZSCAN) and lists. It avoids the blocking KEYS * command, making it production-safe. Supports optional pattern matching and a callback per key or container element. Released as a single-version package with low update cadence. Differentiates from similar tools by supporting all data structures and providing detailed type/key/subkey/value info for each element.
npm install redisscanNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize Redis client, scan all keys matching 'user:*', log each value, then quit.
Provide an each_callback that accepts the correct arguments (type, key, subkey, length, value, cb).
Check for err in done_callback; if an error occurs, it will be passed there.
Use callbacks or promisify with util.promisify() (but note the multiple callbacks pattern may not promisify cleanly).
Adjust count_amt based on expected number of keys and available memory.
Use a Redis lock pattern to ensure consistency if needed.
Use default import: const redisScan = require('redisscan'); or import redisScan from 'redisscan';Provide a function for done_callback, or omit it entirely (it's optional).
Add each_callback function to the options.
Use redis.createClient() from node-redis version 3.x, or adapt to v4+ (which returns a promise).