Skip to content

Commit

Permalink
Fixed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Qard committed Nov 10, 2011
1 parent 7fcf9e9 commit 3c0ecd6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
@@ -1,30 +1,30 @@
# Fig # JSONFig
Fig makes it dead easy to manage a folder full of json config files your app depends on. JSONFig makes it dead easy to manage a folder full of json config files your app depends on.


## Requirements ## Requirements
* Node.js 0.4+ * Node.js 0.4+


## Install ## Install


npm install fig npm install jsonfig


## Usage ## Usage


fig.env('production').load(__dirname+'/config', function (conf) { jsonfig.env('production').load(__dirname+'/config', function (conf) {
console.log(conf.get('redis.host')) console.log(conf.get('redis.host'))
}) })


#### fig.env(name) #### jsonfig.env(name)
Sets the environment name to scope to in your json configs, if available. Sets the environment name to scope to in your json configs, if available.


#### fig.path(path) #### jsonfig.path(path)
Sets the folder to load json configs. NOTE: sub directories aren't supported yet. I'll deal with that later. Sets the folder to load json configs. NOTE: sub directories aren't supported yet. I'll deal with that later.


#### fig.load([path], callback) #### jsonfig.load([path], callback)
This tells fig to start loading the json files and run the callback when it's complete. The callback takes two arguments (err, conf) This tells jsonfig to start loading the json files and run the callback when it's complete. The callback takes two arguments (err, conf)


#### conf.get(path) #### conf.get(path)
As a little bonus, the conf object passed into the fig.load() callback includes a handy little helper for searching for values using a dot-path string. For example; conf.get('redis.host') As a little bonus, the conf object passed into the jsonfig.load() callback includes a handy little helper for searching for values using a dot-path string. For example; conf.get('redis.host')


--- ---


Expand Down

0 comments on commit 3c0ecd6

Please sign in to comment.