Skip to content

Commit 2a768f3

Browse files
committed
updated readme of the createClient() part
1 parent 064260d commit 2a768f3

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

README.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,15 @@ resume sending when you get `drain`.
175175

176176
`client` will emit `idle` when there are no outstanding commands that are awaiting a response.
177177

178-
## redis.createClient(port, host, options)
178+
## redis.createClient()
179179

180-
Create a new client connection. `port` defaults to `6379` and `host` defaults
181-
to `127.0.0.1`. If you have `redis-server` running on the same computer as node, then the defaults for
180+
### overloading
181+
* redis.createClient() = redis.createClient(6379, '127.0.0.1', {})
182+
* redis.createClient(options) = redis.createClient(6379, '127.0.0.1', options)
183+
* redis.createClient(unix_socket, options)
184+
* redis.createClient(port, host, options)
185+
186+
If you have `redis-server` running on the same computer as node, then the defaults for
182187
port and host are probably fine. `options` in an object with the following possible properties:
183188

184189
* `parser`: which Redis protocol reply parser to use. Defaults to `hiredis` if that module is installed.
@@ -234,24 +239,6 @@ You can force an IPv6 if you set the family to 'IPv6'. See nodejs net or dns mod
234239

235240
`createClient()` returns a `RedisClient` object that is named `client` in all of the examples here.
236241

237-
### Unix Domain Socket
238-
239-
You can also create a connection to Redis server via the unix domain socket if the server
240-
has it enabled:
241-
242-
```js
243-
var redis = require("redis");
244-
var client = redis.createClient("/tmp/redis.sock");
245-
```
246-
247-
Sample `redis.conf` configuration to enable unix domain socket listening:
248-
249-
```conf
250-
unixsocket /tmp/redis.sock
251-
unixsocketperm 755
252-
```
253-
254-
See [issue #204](https://github.com/mranney/node_redis/issues/204) for more information.
255242

256243
## client.auth(password, callback)
257244

0 commit comments

Comments
 (0)