Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kof committed Sep 20, 2012
1 parent 9c56d9f commit b808136
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions lib/cjson.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ var fs = require('fs'),
* @type {Object}
*/
exports.options = {
// merge all passed/found config files, see `cjson.extend`
merge: false,
// allows you to do some string replacements, see `cjson.replace`.
replace: null,
// freeze config recursively, see `cjson.freeze`
freeze: false,
// you can use any other extension for your config files, f.e. *.cjson
ext: 'json'
};

Expand Down
13 changes: 7 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,22 @@ Example of such shiny config file:
Load config file from given path, array of paths or directory. Second parameter is optional and can be a boolean or object.

- `path` {String|Array} absolute path to the file, array of paths or directory
- `options` {Boolean|Object} optional options
- `options` {Boolean|Object} optional options. If you pass `true` as second param, its the same like ` {merge: true}` and will merge all configs together.


`options` defaults:

{
// merge all passed/found config files, see `cjson.extend`
merge: false,
// allows you to do some string replacements, see `cjson.replace`.
replace: null,
// freeze config recursively, see `cjson.freeze`
freeze: false,
// you can use any other extension for your config files, f.e. *.cjson
ext: 'json'
}

If you pass `true` as second param, its the same like `{merge: true}` and will merge all configs together.
`replace` allows you to do some string replacements, see `cjson.replace`.
`freeze` - freeze config recursively, see `cjson.freeze`
`ext` - you can use any other extension for your config files, f.e. *.cjson

Examples:

Expand Down Expand Up @@ -97,7 +98,7 @@ Merge the contents of two or more objects together into the first object.

Example:

var object = $.extend({}, object1, object2);
var object = cjson.extend({}, object1, object2);

### cjson.decomment(str)

Expand Down

0 comments on commit b808136

Please sign in to comment.