Redis URL Parse

Spread a Redis URL string into a configuration object.
Module usage
const redisUrlParse = require('redis-url-parse')
redisUrlParse('redis://')
redisUrlParse('redis:///1')
redisUrlParse('redis://example.com:39143/')
redisUrlParse('redis://:n9y25ah7@example.com:39143/')
redisUrlParse('redis://user:hunter2@example.com:39143/')
redisUrlParse('redis://:my%3Asuper%21secure%3Fpassword@example.com:39143/')
Complete example
const redisUrlParse = require('redis-url-parse')
redisUrlParse(process.env.REDIS_URL) // redis://
//=> {host: 'localhost', port: 6379, database: '0', password: undefined}
Prior art
- parse-redis-url not maintained and has an extremely awkward interface
require('parse-redis-url')(null).parse(url)
- redis-url not maintained and requires
redis
as a requirement
- redis-url-parser not maintained and only works if your URL has a password
2.0.0
We now require Node 6.13.0. For older versions, use a 1.x release.
Breaking
- [4851f268ed] - Use WHATWG URL parsing and break old Node compatibility (#10)
Chore
- Updated dependencies (#5, #6, #7)