parse-redis-url-simple parsing redis urls with sentinel support
Simple parser for redis url.
It supports sentinel urls for ioredis
Module usage
const parseRedisUrl = require('parse-redis-url-simple')
parseRedisUrl()
parseRedisUrl('redis://')
parseRedisUrl('redis:///1')
parseRedisUrl('redis://barhost.com:39143/,redis://foohost.com:39143/')
parseRedisUrl('redis://n9y25ah7@foohost.com:39143/')
parseRedisUrl('redis://:n9y25ah7@foohost.com:39143/')
parseRedisUrl('redis://user:hunter2@foohost.com:39143/')
parseRedisUrl('barhost.com:39143,foohost.com:39143,foobarhost.com:39143', sentinel=true)
More examples
Could be found here:
- tests: the set of unit tests.
Prior art
All implementations
are not maintained or not for production use. It looks they were implemented only for testing purposes.
Usually there have been more than one redis server in production. Moreover sometimes it is implemented via cluster or sentinel.