Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 40 lines (28 sloc) 1.057 kB
b91e427 @indexzero [doc] Added README.md
authored
1 # nconf-redis
2
3 A Redis store for [nconf][0]
4
5 ## Installation
6
7 ### Installing npm (node package manager)
8 ``` bash
9 $ curl http://npmjs.org/install.sh | sh
10 ```
11
12 ### Installing nconf-redis
13 ``` bash
14 $ [sudo] npm install nconf
15 $ [sudo] npm install nconf-redis
16 ```
17
18 ## Motivation
19 `tldr;?`: To break the [nconf][0] codebase into small modules that work together.
20
21 ## Usage
22 The store provided by `nconf-redis` will persist all of your configuration settings to a Redis server. All calls to `.get()`, `.set()`, `.clear()`, `.reset()` are asynchronous taking an additional callback parameter.
23
24 The Redis engine also has an in-memory cache with a default TTL of one hour. To change this, just pass the `ttl` option to `.use()`.
25
26 ``` js
27 var nconf = require('nconf');
28
29 //
30 // Requiring `nconf-redis` will extend the `nconf`
31 // module.
32 //
a8c6ea2 @indexzero [doc] Small update to README.md
authored
33 require('nconf-redis');
b91e427 @indexzero [doc] Added README.md
authored
34
36fa059 @pksunkara [api] Add an option to select redis database
pksunkara authored
35 nconf.use('redis', { host: 'localhost', port: 6379, ttl: 60 * 60 * 1000, db: 0 });
b91e427 @indexzero [doc] Added README.md
authored
36 ```
37
38 #### Author: [Charlie Robbins](http://www.nodejitsu.com)
39
40 [0]: https://github.com/indexzero/nconf
Something went wrong with that request. Please try again.