refix icon indicating copy to clipboard operation
refix copied to clipboard

Modern approach (since this project is unmaintained/legacy)

Open titanism opened this issue 1 year ago • 4 comments

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!

titanism avatar Feb 28 '23 20:02 titanism

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.

linus avatar Mar 07 '23 21:03 linus

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!

titanism avatar Mar 07 '23 22:03 titanism

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.

linus avatar Mar 07 '23 23:03 linus

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.

titanism avatar May 05 '23 20:05 titanism