https://github.com/indexzero/nconf-redis
A redis store for nconf
https://github.com/indexzero/nconf-redis
Last synced: 8 months ago
JSON representation
A redis store for nconf
- Host: GitHub
- URL: https://github.com/indexzero/nconf-redis
- Owner: indexzero
- License: mit
- Created: 2011-07-08T16:12:29.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2022-12-27T02:49:42.000Z (over 3 years ago)
- Last Synced: 2025-08-09T11:49:30.181Z (10 months ago)
- Language: JavaScript
- Homepage: http://github.com/indexzero/nconf-redis
- Size: 159 KB
- Stars: 27
- Watchers: 2
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nconf-redis
A Redis store for [nconf][0]
## Installation
### Installing npm (node package manager)
``` bash
$ curl http://npmjs.org/install.sh | sh
```
### Installing nconf-redis
``` bash
$ [sudo] npm install nconf
$ [sudo] npm install nconf-redis
```
## Motivation
`tldr;?`: To break the [nconf][0] codebase into small modules that work together.
## Usage
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.
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()`.
``` js
var nconf = require('nconf');
//
// Requiring `nconf-redis` will extend the `nconf`
// module.
//
require('nconf-redis');
nconf.use('redis', { host: 'localhost', port: 6379, ttl: 60 * 60 * 1000, db: 0 });
```
#### Author: [Charlie Robbins](http://www.nodejitsu.com)
[0]: https://github.com/indexzero/nconf