Parses a Redis URL string into a configuration object with host, port, database, and password fields. Current stable version is 2.0.0. Releases are infrequent; last update was in 2024. Key differentiators: zero dependencies, simple functional API, handles edge cases like URI-encoded passwords and ignored usernames. Alternative to unmaintained packages like parse-redis-url, redis-url, and redis-url-parser.
npm install redis-url-parseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a Redis URL string and logs the configuration object with host, port, database, and password.
Do not rely on username field; use password only.
Encode password using encodeURIComponent before passing URL.
Create a .d.ts file: declare module 'redis-url-parse';
Parse database with Number() if numeric database index is expected.
Upgrade to v2.0.0 or later, which requires Node >=6.13.0.
Use const redisUrlParse = require('redis-url-parse')Run npm install redis-url-parse
URI-encode password: redis://:my%3Asuper%21secure%3Fpassword@host:port/db
Convert to number: Number(config.database)
No dependency data recorded yet.