[dist] Version bump. 0.1.0

This commit is contained in:
indexzero 2011-04-02 05:13:34 -04:00
parent 0fd847cc33
commit ac888dc5a2
3 changed files with 42 additions and 2 deletions

View file

@ -46,12 +46,34 @@ Using nconf is easy; it is designed to be a simple key-value store with support
## Storage Engines ## Storage Engines
### Memory ### Memory
A simple in-memory storage engine that stores a nested JSON representation of the configuration. To use this engine, just call `.use()` with the appropriate arguments. All calls to `.get()`, `.set()`, `.clear()`, `.reset()` methods are synchronous since we are only dealing with an in-memory object.
<pre>
nconf.use('memory');
</pre>
### File ### File
Based on the Memory engine, but provides additional methods `.save()` and `.load()` which allow you to read your configuration to and from file. As with the Memory store, all method calls are synchronous with the exception of `.save()` and `.load()` which take callback functions. It is important to note that setting keys in the File engine will not be persisted to disk until a call to `.save()` is made.
<pre>
nconf.use('file', { file: 'path/to/your/config.json' });
</pre>
The file store is also extensible for multiple file formats, defaulting to `JSON`. To use a custom format, simply pass a format object to the `.use()` method. This object must have `.parse()` and `.stringify()` methods just like the native `JSON` object.
### Redis ### Redis
The Redis engine 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.
<pre>
nconf.use('redis', { host: 'localhost', port: 6379, ttl: 60 * 60 * 1000 });
</pre>
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()`.
## More Documentation ## More Documentation
There is more documentation available through docco. I haven't gotten around to making a gh-pages branch so in the meantime if you clone the repository you can view the docs:
<pre>
open docs/nconf.html
</pre>
## Run Tests ## Run Tests
Tests are written in vows and give complete coverage of all APIs and storage engines. Tests are written in vows and give complete coverage of all APIs and storage engines.
@ -59,4 +81,4 @@ Tests are written in vows and give complete coverage of all APIs and storage eng
vows test/*-test.js --spec vows test/*-test.js --spec
</pre> </pre>
#### Author: [Charlie Robbins](http://www.charlierobbins.com) #### Author: [Charlie Robbins](http://nodejitsu.com)

View file

@ -6,7 +6,6 @@
*/ */
var async = require('async'), var async = require('async'),
eyes = require('eyes'),
redis = require('redis'), redis = require('redis'),
nconf = require('nconf'), nconf = require('nconf'),
Memory = require('./Memory').Memory; Memory = require('./Memory').Memory;

19
package.json Normal file
View file

@ -0,0 +1,19 @@
{
"name": "nconf",
"description": "A hybrid local / remote configuration storage library for node.js.",
"version": "0.1.0",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
"repository": {
"type": "git",
"url": "http://github.com/indexzero/nconf.git"
},
"keywords": ["configuration", "key value store", "redis"],
"dependencies": {
"async": ">= 0.1.8",
"redis": ">= 0.5.9",
"vows": ">= 0.5.8"
},
"main": "./lib/nconf",
"scripts": { "test": "vows test/*-test.js --spec" },
"engines": { "node": ">= 0.4.5" }
}