I implemented repldb indexer syntax in javascript using the Proxy
class.
You can even go beyond that and just access them like properties
Just keep in mind the accesses are still async.
let db = require("./database.js")();
(async () => {
console.log(await db.test); // null on first run
db["easy"] = { value: 15 };
await db.$set("guaranteed_order", 1704); // Access to normal set function
// Otherwise you can't guarantee keys will be set if you use them right after.
console.log(await db.guaranteed_order); // Always 1704
console.log(await db["easy"]);
db.test = 80;
})();