adon-config
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -6,3 +6,2 @@ "use strict"; | ||
const path = require('path'); | ||
const coffee_script = require('coffee-script'); | ||
@@ -44,3 +43,3 @@ let config = {}; | ||
const filename_breakdown = file_path.split('.'); | ||
return filename_breakdown[filename_breakdown.length -1]; | ||
return filename_breakdown[filename_breakdown.length - 1]; | ||
} | ||
@@ -47,0 +46,0 @@ |
{ | ||
"name": "adon-config", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "This module is used for managing system configurations in cascading order.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -16,3 +16,3 @@ # adon-config | ||
```js | ||
let config = require('adon-config').load(); | ||
let config = require('adon-config').load(); //this should be one of the first line of code in your index file | ||
@@ -58,3 +58,3 @@ config.load(__dirname); | ||
```$js | ||
let config = require('adon-config').load() | ||
let config = require('adon-config').get() | ||
console.log(config.database.source); //outputs the source value from common/database | ||
@@ -65,3 +65,13 @@ ``` | ||
## Functions | ||
###Load | ||
loads the config folder from the current project directory then returns the latest config object (this is the first code you must trigger to initialize this module) | ||
```$js | ||
let config = require('adon-config').load() | ||
``` | ||
just returns the latest config object and do nothing else (used for succeeding requests where loading of configurations are no longer needed) | ||
```$js | ||
let config = require('adon-config').get() | ||
``` | ||
@@ -68,0 +78,0 @@ ## Dependencies |
41503
85
66