
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
redis-async-gen
Advanced tools
A little library to make scanning for a set of keys in a Redis database a little bit more tolerable.
A little library to make scanning for a set of keys in a Redis database a little bit more tolerable.
Scanning a Redis database for a key matching a pattern is not necessarily hard, but if you use the standard Redis NPM library, then there's still quite some stuff that you need to carefully handle yourself.
This project figures all of that can be simplified by introducing a generator for scanning keys, allowing the blissfully ignorant JavaScript programmer to simply use a for comprehension:
const redis = require('redis')
const client = redis.createClient(…)
const generators = require('redis-async-gen')
const { keysMatching } = generators.using(client)
…
for await (const key of keysMatching('test*')) {
console.info(key)
}
Under the hoods, this library will execute the scan command repeatedly, fetching new sets of keys whenever it needs. The underlying cursor logic is completely hidden.
If you are using the for comprehension to loop over keys matching a certain pattern, then be advised that you can break out of the loop at any time using the break operation.
The library also has support for scanning values from a Set. The following will retrieve all values from a Set defined at key aaa, starting with the prefix test.
const redis = require('redis')
const client = redis.createClient(…)
const generators = require('redis-async-gen')
const { keysMatching } = generators.using(client)
…
for await (const key of valuesMatching('aaa', 'test*')) {
console.info(key)
}
FAQs
A little library to make scanning for a set of keys in a Redis database a little bit more tolerable.
We found that redis-async-gen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.