A Redis connection string parser that supports standalone, cluster, sentinel, and Unix socket URLs, aligning with Redis-CLI command formats. Current stable version is 1.2.1. The library handles multiple Redis URL syntaxes in a single call, returning structured objects with host, port, db, password, and cluster node arrays. It supports Node 10+. Key differentiators: built-in cluster detection (redis-cluster://) and sentinel support (redis-sentinel://) with master name parsing, unlike simpler parsers.
npm install redis-url-plusNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates parsing standalone, cluster, sentinel, and Unix socket Redis URLs using redis-url-plus.
Ensure you use the correct scheme: 'redis://' for standalone or multiple standalone nodes (no cluster flag), 'redis-cluster://' for explicit cluster mode. When using 'redis://' with multiple hosts separated by comma, the library will return a result with cluster: true and nodes array (undocumented but observed).
Always include the master name in the sentinel URL: redis-sentinel://host:port/master_name/db
Update Node.js to version 14 or later.
Use standard Redis URL format: redis://user:pass@host:port/db. Do not rely on query parameters.
Run `npm install redis-url-plus` or `yarn add redis-url-plus`. Ensure the package is in node_modules.
Use default import: `import RedisUrlParser from 'redis-url-plus'` or CommonJS require: `const RedisUrlParser = require('redis-url-plus')`.Ensure the URL is valid: use one of the supported formats (redis://, redis-cluster://, redis-sentinel://, socket://). Check for typos.
Use type guard: `if ('cluster' in result && result.cluster) { ... }` or cast appropriately.No dependency data recorded yet.