
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.