Open MickL opened 8 months ago
Yeah that is great idea. I have not been working on this library for a while so feel free to fork and adjust the code accordingly based on your needs. Are you trying to build an auth solution. Maybe you can check out Lucia Auth
Nice library! I just have concerns that it loads and saves all keys at once. This might work for a few thousand keys bit it cant scale into infinity. First of all we cant hold an array of infinite size in Node.js depending on the memory size of the server instance. Second when using a database like MongoDB getting all keys out of the database could be too much as well.
Wouldnt it make more sense to load each key from the storage just in time when it is needed?