Connect to Redis using a fully-qualified URL. This package (v1.2.1, last released in 2015) provides a simple connect() wrapper around node_redis that parses the REDIS_URL environment variable or a custom URL, returning a redis client. It also exposes a parse() function that extends Node's url.parse with database and password properties. Unlike ioredis or modern node_redis, this library does not support Redis Cluster, TLS, or advanced features. It is stable but effectively in maintenance mode, as the underlying redis client is outdated. Suitable for legacy projects or simple use cases where only basic Redis connectivity via URL is needed.
npm install redis-urlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize a Redis client from a URL string (or env var), set and get a key, then gracefully close the connection.
Use ioredis or modern node_redis directly: `const Redis = require('ioredis'); const client = new Redis(url);`Use a library that supports redis:// URL parsing with TLS, or manually create a Redis client with tls option.
Convert database to integer: parseInt(parsed.database, 10) || 0
Migrate to ioredis or redis v4 which have built-in URL parsing.
Use Node's built-in url.parse() or URL constructor with searchParams for robust query parsing.
Use require('redis-url').connect() instead of ES import.Start the Redis server (e.g., `redis-server &`). Verify the URL is correct and the server is listening.
Check the URL for correct password: redis://:correctpassword@host:port/db
Ensure the URL argument to parse() is a valid string (e.g., 'redis://localhost:6379').