Redis.createConnectionUrl()

Build a Redis connection URL out of a dictionary of connection options.

Usage

Hover over inputs/exits for more info.

var Redis = require('machinepack-redis');


// Build a Redis connection URL out of a dictionary of connection options.

Redis.createConnectionUrl({

host: '127.0.0.1',

port: '6379',

pass: 'iheartredis',

db: 123,

}).execSync();

Inputs

host

The host (IP or domain) on which the Redis server is running.

'127.0.0.1'
port

The port on which the Redis server is running.

'6379'
pass

The password (if any) for the Redis server.

'iheartredis'
db

The index of the database to connect to.

123

Exits

error

An unexpected error occurred.

success

OK.

'redis://:secret@127.0.0.1:6379/12'