Skip to content

Commit

Permalink
Exposed merge method, updated docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexindigo committed Feb 22, 2016
1 parent 6d702c6 commit e63b7d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,12 @@ var appConfig = configly(path.join(__dirname, 'app-config'));
var rulesConfig = configly(path.join(__dirname, 'rules-config'), {ini: ini.parse});
```

If there is a need to merge config objects into one,
you can use [deeply](http://npmjs.org/deeply) module
or any other package that provides deep merging.
If there is a need to merge standalone config objects into one,
you can use `configly.merge` method manually,
in the order that suites your specific use case.

```javascript
var merge = require('deeply');
var allConfig = merge(appConfig, rulesConfig);
var oneConfig = configly.merge(appConfig, rulesConfig);
```

### More Examples
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ configly._cache = {};

// expose helper functions
configly.load = load;
configly.merge = merge;
// "private" methods
configly._stripBOM = stripBOM;
configly._getFiles = getFiles;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "configly",
"version": "3.0.1",
"version": "3.1.0",
"description": "A developer-friendly lightweight replacement for the \"config\" module that works with custom config directory and pluggable parsers",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,6 +29,7 @@
"directory",
"pluggable",
"parser",
"merge",
"cson",
"hjson",
"ini",
Expand Down

0 comments on commit e63b7d7

Please sign in to comment.