-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Labels
Description
Add .keys(), .values() .entries() methods similar to the Map spec but instead they should return a Promise that resolves to an iterable.
Something like:
const keyv = new Keyv();
await keyv.set('foo', 'bar');
await keyv.set('fizz', 'buzz');
const keys = await keyv.keys();
for (const key of keys) {
console.log(key);
}
// 'foo'
// 'fizz'
const values = await keyv.values();
for (const value of values) {
console.log(value);
}
// 'bar'
// 'buzz'
const entries = await keyv.entries();
for (const [key, value] of entries) {
console.log(`${key} => ${value}`);
}
// 'foo => bar'
// 'fizz => buzz'Reactions are currently unavailable