Now there is a scanIterator()
function in the redis client library that returns an async generator.
This makes it a lot easier to iterate over records using the for await
syntax.
for await (const key of client.scanIterator({ MATCH: 'key-prefix:*' }) {
console.log(key);
}