A small library (v0.1.3) that wraps Redis SCAN operations into async generators, simplifying key scanning in Redis databases. It handles cursor management and pagination, allowing developers to use `for await...of` loops instead of manual iteration. Released sporadically, it supports scanning keys by pattern and scanning set values by pattern. Compared to alternatives like ioredis, it provides a simpler generator-based API but lacks active maintenance and wide adoption.
npm install redis-async-genNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to Redis, scans keys matching 'test*' using async generator, logs each key.
Use the `redis` package (not ioredis) as the client.
Wrap the for-await loop in try-catch to handle Redis errors.
Consider alternatives like ioredis or node-redis-streams.
Use `const generators = require('redis-async-gen'); const { using } = generators;`Const { keysMatching } = generators.using(client); then keysMatching(pattern) works.