easy-configuration
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -116,2 +116,3 @@ // Generated by CoffeeScript 1.6.3 | ||
section = Helpers.expandWithParameters(section, result.parameters); | ||
section = this.extensions[name].afterCompile(section); | ||
result.sections[name] = section; | ||
@@ -118,0 +119,0 @@ } |
@@ -29,2 +29,6 @@ // Generated by CoffeeScript 1.6.3 | ||
Extension.prototype.afterCompile = function(data) { | ||
return data; | ||
}; | ||
return Extension; | ||
@@ -31,0 +35,0 @@ |
{ | ||
"name": "easy-configuration", | ||
"description": "Simply extensible loader for json config files", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"author": { | ||
@@ -33,4 +33,4 @@ "name": "David Kudera", | ||
"scripts": { | ||
"test": "cd ./test; mocha ./index.js;" | ||
"test": "cd ./test; mocha ./index.js --reporter spec;" | ||
} | ||
} |
@@ -24,4 +24,4 @@ # Easy Configuration | ||
Be carefull with setting your path to the config file. Easy-Configuration uses required instead of fs module, because of | ||
ability to use it in browser. If you will set this path relativelly, then it will be relative to the Easy-Configuration | ||
Be careful with setting your path to the config file. Easy-Configuration uses required instead of fs module, because of | ||
ability to use it in browser. If you will set this path relatively, then it will be relative to the Easy-Configuration | ||
file, not to your actual file. | ||
@@ -170,2 +170,18 @@ | ||
### After compile | ||
All data in loadConfiguration are the same like in your json files - parameters are not yet expanded. If you want to work | ||
somehow with expanded data, you will need to rewrite afterCompile method. | ||
But even if you use this method, setup styles for your configuration should be set in loadConfiguration method, not in afterCompile. | ||
This method accept one parameter - data which you returned in loadConfiguration method. You also need to return your updated | ||
data. | ||
``` | ||
section.afterCompile = function(config) { | ||
return doSomething(config); | ||
}; | ||
``` | ||
## Accessing parameters from outside | ||
@@ -183,2 +199,6 @@ | ||
* 1.4.3 | ||
+ Extension: added afterCompile method | ||
+ Some typos in readme | ||
* 1.4.2 | ||
@@ -193,7 +213,7 @@ + Merging uses [recursive-merge](https://npmjs.org/package/recursive-merge) package | ||
+ Created tests | ||
+ Tests can be runned with `npm test` command | ||
+ Tests can be run with `npm test` command | ||
+ Added removeExtension method | ||
* 1.3.3 | ||
+ Removed forgotten dependency on mergin module | ||
+ Removed forgotten dependency on merging module | ||
@@ -208,3 +228,3 @@ * 1.3.2 | ||
* 1.3.0 | ||
+ Whole module is rewriten | ||
+ Whole module is rewritten | ||
@@ -211,0 +231,0 @@ * 1.2.0 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26447
449
258