refix
refix copied to clipboard
Modern approach (since this project is unmaintained/legacy)
Hey! This package probably still works for older versions, but the commands have been updated and need refreshed here too.
See our comment at https://github.com/luin/ioredis/issues/983#issuecomment-1448839874 for insight into how this could be accomplished. Feel free to re-use this source code we shared @linus in your project and publish a new version.
If you want us to help maintain this, then please add "titanism" user on GitHub and npm to the refix
package. We'd gladly help maintain it!
Hi @titanism 👋 and thank you for the interest! Indeed, this module is sorely out of date. I am pretty sure that ioredis already supports prefixing? I guess the only thing still unique to refix is that it also supports e.g. keys
and perhaps a few other commands, transparently stripping the prefix when returning.
The only way (without using an approach as I mentioned above) is to create an entirely new instance with keyPrefix
option. This results in having to create multiple Redis instances and connections, instead of being able to re-use the same one for simply setting a key prefix differently on a per-command basis.
Would love if we can get access here on GitHub and npm to modernize this repo as per above example!
Currently already integrated into @forwardemail!
Ah I see now what you mean. Sounds fair! Would it be terribly rude of me to ask for a pull request with your suggested changes, first? I haven't followed redis development in detail for a while but I am sure I can weigh in on a refactor.
I have no issues in principle of changing from CS to JS and add missing commands, it should be straight forward. If we make some headway on a PR I'll gladly add @titanism as a collaborator.
Thanks, hopefully can visit this and submit a PR sometime soon.
For now, see https://github.com/luin/ioredis/issues/983#issuecomment-1536728696 as we added support for Map and Object for mset
and mget
.