diff --git a/lib/cjson.js b/lib/cjson.js index 29e8088..ba08677 100644 --- a/lib/cjson.js +++ b/lib/cjson.js @@ -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' }; diff --git a/readme.md b/readme.md index 415dd14..aed698f 100644 --- a/readme.md +++ b/readme.md @@ -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: @@ -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)