Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made watchForConfigChanges public and updated docs

  • Loading branch information...
commit 263062f3680c3998054f0978b2c6891e46f997e0 1 parent fc25d4e
Loren West authored Loren West committed
View
1  .gitignore
@@ -0,0 +1 @@
+.project
View
2  config/runtime.json
@@ -2,5 +2,5 @@
"Customers": {
"dbName": "override_from_runtime_json"
},
- "watchThisValue": 64603
+ "watchThisValue": 54293
}
View
10 doc/1-protected-test.js.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test 1-protected-test.js </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -407,7 +407,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
View
16 doc/2-config-test.js.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test 2-config-test.js </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -150,7 +150,7 @@
<span class="p">}</span>
<span class="p">},</span>
- <span class="s1">&#39;Change Notification Tests&#39;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s1">&#39;Internal Change Notification Tests&#39;</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">topic</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">// Attach this topic as a watcher</span>
@@ -191,7 +191,7 @@
<span class="nx">assert</span><span class="p">.</span><span class="nx">equal</span><span class="p">(</span><span class="nx">CONFIG</span><span class="p">.</span><span class="nx">watchThisValue</span><span class="p">,</span> <span class="nx">newWatchedValue</span><span class="p">);</span>
<span class="p">},</span>
- <span class="s1">&#39;waiting for O/S change notification...&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
+ <span class="s1">&#39;Waiting for the O/S to notify us of changes...&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// This is just a message for the next test</span>
<span class="nx">assert</span><span class="p">.</span><span class="nx">isTrue</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
<span class="p">}</span>
@@ -206,7 +206,7 @@
<span class="nx">t</span><span class="p">.</span><span class="nx">callback</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="nx">CONFIG</span><span class="p">.</span><span class="nx">_parseFile</span><span class="p">(</span><span class="nx">runtimeJsonFilename</span><span class="p">));</span>
<span class="p">});</span>
<span class="p">},</span>
- <span class="s1">&#39;The O/S notified us of the configuration file change&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">runtimeObj</span><span class="p">)</span> <span class="p">{</span>
+ <span class="s1">&#39;The runtime.json file was changed&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">runtimeObj</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">assert</span><span class="p">.</span><span class="nx">isTrue</span><span class="p">(</span><span class="o">!</span><span class="nx">err</span><span class="p">);</span>
<span class="p">},</span>
<span class="s1">&#39;Prior configuration values were kept intact&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">runtimeObj</span><span class="p">)</span> <span class="p">{</span>
@@ -259,7 +259,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
View
109 doc/Config.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>config Config </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.38" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.38" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.63" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.63" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.38"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.38"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.63"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.63"></script>
</head>
<body id="node-monitor">
@@ -738,52 +738,6 @@ <h3 id="methods">Methods</h3>
</div>
<hr />
</div>
- <div class="protected" rel="yui:method" resource="#method__watchForConfigFileChanges">
- <h4>
- <a name="method__watchForConfigFileChanges">_watchForConfigFileChanges</a></h4>
- <div class="detail" >
- <code>
- protected
-
-
- void
- <strong property="yui:name">_watchForConfigFileChanges</strong>
- (
- )
- </code>
-
- <div class="description" property="yui:description">
- Monitor the filesystem for configuration file changes.
-<p>
-Runtime configuration changes are made by modifying the runtime.json file.
-This paradigm allows multiple application servers to internally notify
-listeners whenever the configuration changes.
-</p>
-<p>
-This method attaches the file watcher onto the runtime.json file, reloading
-the file on change and merging the new values into the CONFIG object.
-</p>
- </div>
-
- <div class="description">
-
-
- <dl>
- <dt>Returns:
- <code property="yui:return">
- void
- </code></dt>
- <dd property="yui:returnInfo"></dd>
- </dl>
-
-
-
-
- </div>
-
- </div>
- <hr />
- </div>
<div class="" rel="yui:method" resource="#method_constructor">
<h4>
<a name="method_constructor">constructor</a></h4>
@@ -1110,6 +1064,55 @@ <h3 id="methods">Methods</h3>
</div>
<hr />
</div>
+ <div class="" rel="yui:method" resource="#method_watchForConfigFileChanges">
+ <h4>
+ <a name="method_watchForConfigFileChanges">watchForConfigFileChanges</a></h4>
+ <div class="detail" >
+ <code>
+
+
+
+ void
+ <strong property="yui:name">watchForConfigFileChanges</strong>
+ (
+ )
+ </code>
+
+ <div class="description" property="yui:description">
+ Monitor the runtime.json file for configuration changes.
+<p>
+Long running processes can call this method at startup to have node-config
+automatically monitor and apply changes made to the config/runtime.json file.
+</p>
+<p>
+This paradigm allows for manual changes to running application servers,
+and for multi-node application servers to keep in sync.
+</p>
+<p>
+This method attaches a file watcher onto the runtime.json file, reloading
+the file on change and merging the new values into the CONFIG object.
+</p>
+ </div>
+
+ <div class="description">
+
+
+ <dl>
+ <dt>Returns:
+ <code property="yui:return">
+ void
+ </code></dt>
+ <dd property="yui:returnInfo"></dd>
+ </dl>
+
+
+
+
+ </div>
+
+ </div>
+ <hr />
+ </div>
</div>
</div>
@@ -1165,11 +1168,11 @@ <h3 id="methods">Methods</h3>
<li class="protected"><a href="#method__parseFile" title="_parseFile">_parseFile</a></li>
<li class="protected"><a href="#method__persistConfigsOnChange" title="_persistConfigsOnChange">_persistConfigsOnChange</a></li>
<li class="protected"><a href="#method__stripComments" title="_stripComments">_stripComments</a></li>
- <li class="protected"><a href="#method__watchForConfigFileChanges" title="_watchForConfigFileChanges">_watchForConfigFileChanges</a></li>
<li class=""><a href="#method_constructor" title="constructor">constructor</a></li>
<li class=""><a href="#method_makeImmutable" title="makeImmutable">makeImmutable</a></li>
<li class=""><a href="#method_setModuleDefaults" title="setModuleDefaults">setModuleDefaults</a></li>
<li class=""><a href="#method_watch" title="watch">watch</a></li>
+ <li class=""><a href="#method_watchForConfigFileChanges" title="watchForConfigFileChanges">watchForConfigFileChanges</a></li>
</ul>
</div>
@@ -1181,11 +1184,11 @@ <h3 id="methods">Methods</h3>
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
- ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method__watchForConfigFileChanges", "access": "protected", "host": "Config", "type": "method", "name": "_watchForConfigFileChanges"}];
+ ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method_watchForConfigFileChanges", "access": "", "host": "Config", "type": "method", "name": "watchForConfigFileChanges"}];
</script>
</body>
</html>
View
10 doc/ConfigTest.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test ConfigTest </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -119,7 +119,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
View
10 doc/ProtectedTest.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test ProtectedTest </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -119,7 +119,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
View
32 doc/config.js.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>config config.js </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.38" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.38" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.63" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.63" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.38"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.38"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.63"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.63"></script>
</head>
<body id="node-monitor">
@@ -141,7 +141,6 @@
<span class="kd">var</span> <span class="nx">Config</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
<span class="nx">t</span><span class="p">.</span><span class="nx">_loadFileConfigs</span><span class="p">();</span>
- <span class="nx">t</span><span class="p">.</span><span class="nx">_watchForConfigFileChanges</span><span class="p">();</span>
<span class="nx">t</span><span class="p">.</span><span class="nx">_persistConfigsOnChange</span><span class="p">();</span>
<span class="p">};</span>
@@ -401,23 +400,26 @@
<span class="p">};</span>
<span class="cm">/**</span>
-<span class="cm"> * Monitor the filesystem for configuration file changes.</span>
+<span class="cm"> * Monitor the runtime.json file for configuration changes.</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;p&gt;</span>
-<span class="cm"> * Runtime configuration changes are made by modifying the runtime.json file.</span>
-<span class="cm"> * This paradigm allows multiple application servers to internally notify</span>
-<span class="cm"> * listeners whenever the configuration changes.</span>
+<span class="cm"> * Long running processes can call this method at startup to have node-config </span>
+<span class="cm"> * automatically monitor and apply changes made to the config/runtime.json file.</span>
+<span class="cm"> * &lt;/p&gt;</span>
+<span class="cm"> * </span>
+<span class="cm"> * &lt;p&gt;</span>
+<span class="cm"> * This paradigm allows for manual changes to running application servers,</span>
+<span class="cm"> * and for multi-node application servers to keep in sync.</span>
<span class="cm"> * &lt;/p&gt;</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;p&gt;</span>
-<span class="cm"> * This method attaches the file watcher onto the runtime.json file, reloading</span>
+<span class="cm"> * This method attaches a file watcher onto the runtime.json file, reloading</span>
<span class="cm"> * the file on change and merging the new values into the CONFIG object.</span>
<span class="cm"> * &lt;/p&gt;</span>
<span class="cm"> *</span>
-<span class="cm"> * @protected</span>
-<span class="cm"> * @method _watchForConfigFileChanges</span>
+<span class="cm"> * @method watchForConfigFileChanges</span>
<span class="cm"> */</span>
-<span class="nx">Config</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">_watchForConfigFileChanges</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">Config</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">watchForConfigFileChanges</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">// Attach the file watcher</span>
<span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
@@ -1027,11 +1029,11 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
- ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method__watchForConfigFileChanges", "access": "protected", "host": "Config", "type": "method", "name": "_watchForConfigFileChanges"}];
+ ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method_watchForConfigFileChanges", "access": "", "host": "Config", "type": "method", "name": "watchForConfigFileChanges"}];
</script>
</body>
</html>
View
19 doc/index.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title> </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.48" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.48" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.65" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.65" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.48"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.48"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.65"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.65"></script>
</head>
<body id="node-monitor">
@@ -191,9 +191,10 @@
</p>
<p>
If configuration values change at runtime, these changes are persisted
- into the runtime.json file within the config directory. Application
- instances monitor changes to this file to keep configuration values
- consistent among the different application instances.
+ into the runtime.json file within the config directory. Multi-node
+ application instances can keep in synch by calling the
+ <a href="Config.html#method_watchForConfigFileChanges">watchForConfigFileChanges</a>
+ method at startup.
</p>
<p>
This paradigm does not currently extend beyond a single machine.
@@ -268,11 +269,11 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
- ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method__watchForConfigFileChanges", "access": "protected", "host": "Config", "type": "method", "name": "_watchForConfigFileChanges"}];
+ ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method_watchForConfigFileChanges", "access": "", "host": "Config", "type": "method", "name": "watchForConfigFileChanges"}];
</script>
</body>
</html>
View
2  doc/index.json
@@ -1 +1 @@
-[{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method__watchForConfigFileChanges", "access": "protected", "host": "Config", "type": "method", "name": "_watchForConfigFileChanges"}]
+[{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method_watchForConfigFileChanges", "access": "", "host": "Config", "type": "method", "name": "watchForConfigFileChanges"}]
View
12 doc/module_config.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>config </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.38" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.38" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.63" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.63" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.38"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.38"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.63"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.63"></script>
</head>
<body id="node-monitor">
@@ -141,11 +141,11 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
- ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method__watchForConfigFileChanges", "access": "protected", "host": "Config", "type": "method", "name": "_watchForConfigFileChanges"}];
+ ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method_watchForConfigFileChanges", "access": "", "host": "Config", "type": "method", "name": "watchForConfigFileChanges"}];
</script>
</body>
</html>
View
10 doc/module_test.html
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -112,7 +112,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
View
2  doc/raw.json
@@ -1 +1 @@
-{"majorversion": 3, "classmap": {"ConfigTest": {"name": "ConfigTest", "namespace": "", "module": "test", "guessedname": "ConfigTest", "file": "2-config-test.js", "guessedtype": "property", "shortname": "ConfigTest", "description": "<p>Unit tests for the node-config library. To run type:</p>\n<pre>npm test config</pre>"}, "Config": {"name": "Config", "namespace": "", "module": "config", "methods": {"_attachProtoDeep": {"return": {"type": "", "description": "toObject"}, "description": "Attach the Config class prototype to all config objects recursively.\n<p>\nThis allows you to do anything with CONFIG sub-objects as you can do with\nthe top-level CONFIG object. It's so you can do this:\n</p>\n<pre>\nvar CUST_CONFIG = require('config').Customer;\nCUST_CONFIG.watch(...)\n</pre>", "protected": "", "params": [{"type": "", "name": "toObject", "description": ""}, {"type": "", "name": "depth", "description": ""}], "guessedname": "_attachProtoDeep", "guessedtype": "function"}, "_watchForConfigFileChanges": {"protected": "", "description": "Monitor the filesystem for configuration file changes.\n<p>\nRuntime configuration changes are made by modifying the runtime.json file.\nThis paradigm allows multiple application servers to internally notify\nlisteners whenever the configuration changes.\n</p>\n<p>\nThis method attaches the file watcher onto the runtime.json file, reloading\nthe file on change and merging the new values into the CONFIG object.\n</p>", "guessedname": "_watchForConfigFileChanges", "guessedtype": "function"}, "_persistConfigsOnChange": {"protected": "", "params": [{"type": "object", "name": "object", "description": " - The config object to watch"}], "description": "<p>\nWatch the specified object for a change in properties, and persist changes\nto runtime.json when a change is detected.\n</p>", "guessedname": "_persistConfigsOnChange", "guessedtype": "function"}, "setModuleDefaults": {"return": {"type": "object", "description": "moduleConfig - The module level configuration object."}, "params": [{"type": "string", "name": "moduleName", "description": " - Name of your module."}, {"type": "object", "name": "defaultProperties", "description": " - The default module configuration."}], "description": "<p>\nSet default configurations for a node.js module.\n</p>\n<p>\nThis allows module developers to attach their configurations onto the \ndefault configuration object so they can be configured by the consumers\nof the module.\n</p>\n<p>Using the function within your module:</p>\n<pre>\nvar CONFIG = require(\"config\");\nCONFIG.setModuleDefaults(\"MyModule\", {\n&nbsp;&nbsp;templateName: \"t-50\",\n&nbsp;&nbsp;colorScheme: \"green\"\n});\n<br>\n// Template name may be overridden by application config files\nconsole.log(\"Template: \" + CONFIG.MyModule.templateName);\n</pre>\n<p>\nThe above example results in a \"MyModule\" element of the configuration\nobject, containing an object with the specified default values.\n</p>", "guessedname": "setModuleDefaults", "guessedtype": "function"}, "_diffDeep": {"return": {"type": "object", "description": "A differential object, which if extended onto object1 would\nresult in object2."}, "description": "Returns an object containing all elements that differ between two objects.\n<p>\nThis method was designed to be used to create the runtime.json file\ncontents, but can be used to get the diffs between any two Javascript objects.\n</p>\n<p>\nIt works best when object2 originated by deep copying object1, then \nchanges were made to object2, and you want an object that would give you\nthe changes made to object1 which resulted in object2.\n</p>", "protected": "", "params": [{"type": "object", "name": "object1", "description": " The base object to compare to"}, {"type": "object", "name": "object2", "description": " The object to compare with"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_diffDeep", "guessedtype": "function"}, "_stripComments": {"return": {"type": "string", "description": "The string with comments stripped."}, "description": "Strip all Javascript type comments from the string.\nThe string is usually a file loaded from the O/S, containing\nnewlines and javascript type comments.\nThanks to James Padolsey, and all who conributed to this implementation.\nhttp://james.padolsey.com/javascript/javascript-comment-removal-revisted/", "protected": "", "params": [{"type": "string", "name": "fileString", "description": " The string to strip comments from"}], "guessedname": "_stripComments", "guessedtype": "function"}, "watch": {"return": {"type": "object", "description": "object - The original object is returned - for chaining."}, "params": [{"type": "object", "name": "object", "description": " - The object to watch."}, {"type": "string", "name": "property", "description": " - The property name to watch. Watch all object properties if null."}, {"type": "function(object, propertyName, priorValue, newValue)", "name": "handler", "description": " - Handler called when a property change is detected.\nThe handler is run along with other handlers registered for notification.\nIf your handler changes the value of the property, that change is applied after all handlers have finished processing the current change.\nThen all handlers (including this one) will be called again with the newly changed value."}, {"type": "integer", "name": "depth", "description": " (optional) - If watching all object properties or if the specified property is an object, this specifies the depth of the object graph to watch for changes. Default 6."}], "description": "<p>Monitor a configuration value for runtime changes.</p>\n<p>\nConfiguration values can be changed at runtime by the application or by a \nmanual change to the config/runtime.json file. \nThis method lets you specify a function to run when a configuration \nvalue changes. \n</p>\n<p>\nThis was built for monitoring changes to configuration values,\nbut it can be used for watching changes to any javascript object.\n</p>\n<p>Example:</p>\n<pre>\nvar CONFIG = require('config').customer;\n...\n// Watch for any changes to the customer configuration\nCONFIG.watch(CONFIG, null, function(object, propertyName, priorValue, newValue) {\n&nbsp;console.log(\"Customer configuration \" + propertyName + \" changed from \" + priorValue + \" to \" + newValue);\n});\n</pre>", "guessedname": "watch", "guessedtype": "function"}, "_equalsDeep": {"return": {"type": "boolean", "description": "True if both objects have equivalent contents"}, "description": "Return true if two objects have equal contents.", "protected": "", "params": [{"type": "object", "name": "object1", "description": " The object to compare from"}, {"type": "object", "name": "object2", "description": " The object to compare with"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_equalsDeep", "guessedtype": "function"}, "makeImmutable": {"return": {"type": "object", "description": "object - The original object is returned - for chaining."}, "params": [{"type": "object", "name": "object", "description": " - The object to attach an immutable property into."}, {"type": "string", "name": "property", "description": " - The name of the property to make immutable."}], "description": "<p>Make a configuration property immutable (assuring it cannot be changed\nfrom the current value).</p>\n<p>\nThis method was built for disabling runtime changes to configuration values,\nbut it can be applied to any javascript object.\n</p>\n<p>\nThis operation cannot be un-done.\n</p>\n<p>Example:</p>\n<pre>\nvar CONFIG = require('config').customer;\n...\n// Obtain a DB connection using CONFIG parameters\ndatabase.open(CONFIG.db.name, CONFIG.db.port);\n...\n// Don't allow database changes after connect\nCONFIG.makeImmutable(CONFIG.db, 'name');\nCONFIG.makeImmutable(CONFIG.db, 'port');\n</pre>", "guessedname": "makeImmutable", "guessedtype": "function"}, "_cloneDeep": {"return": {"type": "object", "description": "A new object with the elements copied from the copyFrom object"}, "description": "Return a deep copy of the specified object.\nThis returns a new object with all elements copied from the specified\nobject. Deep copies are made of objects and arrays so you can do anything\nwith the returned object without affecting the input object.", "protected": "", "params": [{"type": "object", "name": "copyFrom", "description": " The original object to copy from"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_cloneDeep", "guessedtype": "function"}, "_loadFileConfigs": {"protected": "", "return": {"type": "this", "description": "The configuration object"}, "description": "Load the individual file configurations.\n<p>\nThis method builds a map of filename to the configuration object defined\nby the file. The search order is:\n</p>\n<pre>\ndefault.EXT\n(hostname).EXT\n(deployment).EXT\n(hostname)-(deployment).EXT\nruntime.json\n</pre>\n<p>\nEXT can be yaml, json, or js signifying the file type. yaml is in YAML format,\njson is in strict JSON format, and js is a javascript executable file that is\nrequire()'d with module.exports being the config object.\n</p>\n<p>\n(hostname) is the $HOST environment variable if set, otherwise the\nhostname found from require('os').hostname()\n</p>\n<p>\n(deployment) is the deployment type, found in the $NODE_ENV environment\nvariable. Defaults to 'development'.\n</p>\n<p>\nThe runtime.json file contains configuration changes made at runtime either\nmanually, or by the application setting a configuration value.\n</p>", "guessedname": "_loadFileConfigs", "guessedtype": "function"}, "constructor": {"return": {"type": "object", "description": "CONFIG - The top level configuration object"}, "description": "<p>Get the configuration object.</p>\n<p>\nThe configuration object is a shared singleton object within the applicaiton,\nattained by calling require('config').\n</p>\n<p>\nUsually you'll specify a CONFIG variable at the top of your .js file\nfor file/module scope. If you want the root of the object, you can do this:\n</p>\n<pre>\nvar CONFIG = require('config');\n</pre>\n<p>\nSometimes you only care about a specific sub-object within the CONFIG\nobject. In that case you could do this at the top of your file:\n</p>\n<pre>\nvar CONFIG = require('config').customer;\nor\nvar CUSTOMER_CONFIG = require('config').customer;\n</pre>\n<script type=\"text/javascript\">\ndocument.getElementById(\"showProtected\").style.display = \"block\";\n</script>", "guessedname": "Config", "guessedtype": "function"}, "_extendDeep": {"return": {"type": "object", "description": "The altered mergeInto object is returned"}, "description": "Extend an object, and any object it contains.\nThis does not replace deep objects, but dives into them\nreplacing individual elements instead.", "protected": "", "params": [{"type": "object", "name": "mergeInto", "description": " The object to merge into"}, {"type": "object...", "name": "mergeFrom...", "description": " - Any number of objects to merge from"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_extendDeep", "guessedtype": "function"}, "_isObject": {"return": {"type": "boolean", "description": "TRUE if the arg is an object, FALSE if not"}, "description": "Is the specified argument a regular javascript object?\nThe argument is an object if it's a JS object, but not an array.", "protected": "", "params": [{"type": "MIXED", "name": "arg", "description": " An argument of any type."}], "guessedname": "_isObject", "guessedtype": "function"}, "_parseFile": {"return": {"type": "configObject", "description": "The configuration object parsed from the file"}, "description": "Parse and return the specified configuration file.\nIf the file exists in the application config directory, it will\nparse and return it as a JavaScript object.\nThe file extension determines the parser to use.\n.js = File to run that has a module.exports containing the config object\n.json = File is parsed using JSON.parse()\n.yaml = Parsed with a YAML parser\nIf the file doesn't exist, a null will be returned.\nIf the file can't be parsed, an exception will be thrown.", "protected": "", "params": [{"type": "string", "name": "fullFilename", "description": " The full file path and name"}], "guessedname": "_parseFile", "guessedtype": "function"}}, "file": "config.js", "shortname": "Config", "description": "<p>Runtime Application Configurations</p>\n<p>\nThe config module exports a singleton object representing all runtime\nconfigurations for this application deployment.\n</p>\n<p>\nApplication configurations are stored in files within the config directory\nof your application. The default configuration file is loaded, followed\nby files specific to the deployment type (development, testing, staging,\nproduction, etc.).\n</p>\n<p>\nFor example, with the following config/default.yaml file:\n</p>\n<pre>\n...\ncustomer:\n&nbsp;&nbsp;initialCredit: 500\n&nbsp;&nbsp;db:\n&nbsp;&nbsp;&nbsp;&nbsp;name: customer\n&nbsp;&nbsp;&nbsp;&nbsp;port: 5984\n...\n</pre>\n<p>\nThe following code loads the customer section into the CONFIG variable:\n<p>\n<pre>\nvar CONFIG = require('config').customer;\n...\nnewCustomer.creditLimit = CONFIG.initialCredit;\ndatabase.open(CONFIG.db.name, CONFIG.db.port);\n...\n</pre>"}, "ProtectedTest": {"name": "ProtectedTest", "namespace": "", "module": "test", "guessedname": "PrivateTest", "file": "1-protected-test.js", "guessedtype": "property", "shortname": "ProtectedTest", "description": "<p>Tests for underlying node-config utilities. To run type:</p>\n<pre>npm test config</pre>"}}, "version": "0.4.2", "modules": {"test": {"description": "<p>Unit tests</p>", "submodules": [], "classlist": ["ProtectedTest", "ConfigTest"], "filelist": ["1-protected-test.js", "2-config-test.js"], "subdata": {}, "name": "test"}, "config": {"description": "<p>Runtime Application Configurations</p>\n<p>\nThe config module exports a singleton object representing all runtime\nconfigurations for this application deployment.\n</p>\n<p>\nApplication configurations are stored in files within the config directory\nof your application. The default configuration file is loaded, followed\nby files specific to the deployment type (development, testing, staging,\nproduction, etc.).\n</p>\n<p>\nFor example, with the following config/default.yaml file:\n</p>\n<pre>\n...\ncustomer:\n&nbsp;&nbsp;initialCredit: 500\n&nbsp;&nbsp;db:\n&nbsp;&nbsp;&nbsp;&nbsp;name: customer\n&nbsp;&nbsp;&nbsp;&nbsp;port: 5984\n...\n</pre>\n<p>\nThe following code loads the customer section into the CONFIG variable:\n<p>\n<pre>\nvar CONFIG = require('config').customer;\n...\nnewCustomer.creditLimit = CONFIG.initialCredit;\ndatabase.open(CONFIG.db.name, CONFIG.db.port);\n...\n</pre>", "submodules": [], "classlist": ["Config"], "filelist": ["config.js"], "subdata": {}, "name": "config"}}, "filemap": {"2-config-test.js": {"classlist": ["ConfigTest"], "name": "2-config-test.js", "module": "test"}, "config.js": {"classlist": ["Config"], "name": "config.js", "module": "config"}, "1-protected-test.js": {"classlist": ["ProtectedTest"], "name": "1-protected-test.js", "module": "test"}}}
+{"majorversion": 3, "classmap": {"ConfigTest": {"name": "ConfigTest", "namespace": "", "module": "test", "guessedname": "ConfigTest", "file": "2-config-test.js", "guessedtype": "property", "shortname": "ConfigTest", "description": "<p>Unit tests for the node-config library. To run type:</p>\n<pre>npm test config</pre>"}, "Config": {"name": "Config", "namespace": "", "module": "config", "methods": {"watchForConfigFileChanges": {"description": "Monitor the runtime.json file for configuration changes.\n<p>\nLong running processes can call this method at startup to have node-config \nautomatically monitor and apply changes made to the config/runtime.json file.\n</p>\n<p>\nThis paradigm allows for manual changes to running application servers,\nand for multi-node application servers to keep in sync.\n</p>\n<p>\nThis method attaches a file watcher onto the runtime.json file, reloading\nthe file on change and merging the new values into the CONFIG object.\n</p>", "guessedname": "watchForConfigFileChanges", "guessedtype": "function"}, "_attachProtoDeep": {"return": {"type": "", "description": "toObject"}, "description": "Attach the Config class prototype to all config objects recursively.\n<p>\nThis allows you to do anything with CONFIG sub-objects as you can do with\nthe top-level CONFIG object. It's so you can do this:\n</p>\n<pre>\nvar CUST_CONFIG = require('config').Customer;\nCUST_CONFIG.watch(...)\n</pre>", "protected": "", "params": [{"type": "", "name": "toObject", "description": ""}, {"type": "", "name": "depth", "description": ""}], "guessedname": "_attachProtoDeep", "guessedtype": "function"}, "_persistConfigsOnChange": {"protected": "", "params": [{"type": "object", "name": "object", "description": " - The config object to watch"}], "description": "<p>\nWatch the specified object for a change in properties, and persist changes\nto runtime.json when a change is detected.\n</p>", "guessedname": "_persistConfigsOnChange", "guessedtype": "function"}, "setModuleDefaults": {"return": {"type": "object", "description": "moduleConfig - The module level configuration object."}, "params": [{"type": "string", "name": "moduleName", "description": " - Name of your module."}, {"type": "object", "name": "defaultProperties", "description": " - The default module configuration."}], "description": "<p>\nSet default configurations for a node.js module.\n</p>\n<p>\nThis allows module developers to attach their configurations onto the \ndefault configuration object so they can be configured by the consumers\nof the module.\n</p>\n<p>Using the function within your module:</p>\n<pre>\nvar CONFIG = require(\"config\");\nCONFIG.setModuleDefaults(\"MyModule\", {\n&nbsp;&nbsp;templateName: \"t-50\",\n&nbsp;&nbsp;colorScheme: \"green\"\n});\n<br>\n// Template name may be overridden by application config files\nconsole.log(\"Template: \" + CONFIG.MyModule.templateName);\n</pre>\n<p>\nThe above example results in a \"MyModule\" element of the configuration\nobject, containing an object with the specified default values.\n</p>", "guessedname": "setModuleDefaults", "guessedtype": "function"}, "_diffDeep": {"return": {"type": "object", "description": "A differential object, which if extended onto object1 would\nresult in object2."}, "description": "Returns an object containing all elements that differ between two objects.\n<p>\nThis method was designed to be used to create the runtime.json file\ncontents, but can be used to get the diffs between any two Javascript objects.\n</p>\n<p>\nIt works best when object2 originated by deep copying object1, then \nchanges were made to object2, and you want an object that would give you\nthe changes made to object1 which resulted in object2.\n</p>", "protected": "", "params": [{"type": "object", "name": "object1", "description": " The base object to compare to"}, {"type": "object", "name": "object2", "description": " The object to compare with"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_diffDeep", "guessedtype": "function"}, "_stripComments": {"return": {"type": "string", "description": "The string with comments stripped."}, "description": "Strip all Javascript type comments from the string.\nThe string is usually a file loaded from the O/S, containing\nnewlines and javascript type comments.\nThanks to James Padolsey, and all who conributed to this implementation.\nhttp://james.padolsey.com/javascript/javascript-comment-removal-revisted/", "protected": "", "params": [{"type": "string", "name": "fileString", "description": " The string to strip comments from"}], "guessedname": "_stripComments", "guessedtype": "function"}, "watch": {"return": {"type": "object", "description": "object - The original object is returned - for chaining."}, "params": [{"type": "object", "name": "object", "description": " - The object to watch."}, {"type": "string", "name": "property", "description": " - The property name to watch. Watch all object properties if null."}, {"type": "function(object, propertyName, priorValue, newValue)", "name": "handler", "description": " - Handler called when a property change is detected.\nThe handler is run along with other handlers registered for notification.\nIf your handler changes the value of the property, that change is applied after all handlers have finished processing the current change.\nThen all handlers (including this one) will be called again with the newly changed value."}, {"type": "integer", "name": "depth", "description": " (optional) - If watching all object properties or if the specified property is an object, this specifies the depth of the object graph to watch for changes. Default 6."}], "description": "<p>Monitor a configuration value for runtime changes.</p>\n<p>\nConfiguration values can be changed at runtime by the application or by a \nmanual change to the config/runtime.json file. \nThis method lets you specify a function to run when a configuration \nvalue changes. \n</p>\n<p>\nThis was built for monitoring changes to configuration values,\nbut it can be used for watching changes to any javascript object.\n</p>\n<p>Example:</p>\n<pre>\nvar CONFIG = require('config').customer;\n...\n// Watch for any changes to the customer configuration\nCONFIG.watch(CONFIG, null, function(object, propertyName, priorValue, newValue) {\n&nbsp;console.log(\"Customer configuration \" + propertyName + \" changed from \" + priorValue + \" to \" + newValue);\n});\n</pre>", "guessedname": "watch", "guessedtype": "function"}, "_equalsDeep": {"return": {"type": "boolean", "description": "True if both objects have equivalent contents"}, "description": "Return true if two objects have equal contents.", "protected": "", "params": [{"type": "object", "name": "object1", "description": " The object to compare from"}, {"type": "object", "name": "object2", "description": " The object to compare with"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_equalsDeep", "guessedtype": "function"}, "makeImmutable": {"return": {"type": "object", "description": "object - The original object is returned - for chaining."}, "params": [{"type": "object", "name": "object", "description": " - The object to attach an immutable property into."}, {"type": "string", "name": "property", "description": " - The name of the property to make immutable."}], "description": "<p>Make a configuration property immutable (assuring it cannot be changed\nfrom the current value).</p>\n<p>\nThis method was built for disabling runtime changes to configuration values,\nbut it can be applied to any javascript object.\n</p>\n<p>\nThis operation cannot be un-done.\n</p>\n<p>Example:</p>\n<pre>\nvar CONFIG = require('config').customer;\n...\n// Obtain a DB connection using CONFIG parameters\ndatabase.open(CONFIG.db.name, CONFIG.db.port);\n...\n// Don't allow database changes after connect\nCONFIG.makeImmutable(CONFIG.db, 'name');\nCONFIG.makeImmutable(CONFIG.db, 'port');\n</pre>", "guessedname": "makeImmutable", "guessedtype": "function"}, "_cloneDeep": {"return": {"type": "object", "description": "A new object with the elements copied from the copyFrom object"}, "description": "Return a deep copy of the specified object.\nThis returns a new object with all elements copied from the specified\nobject. Deep copies are made of objects and arrays so you can do anything\nwith the returned object without affecting the input object.", "protected": "", "params": [{"type": "object", "name": "copyFrom", "description": " The original object to copy from"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_cloneDeep", "guessedtype": "function"}, "_loadFileConfigs": {"protected": "", "return": {"type": "this", "description": "The configuration object"}, "description": "Load the individual file configurations.\n<p>\nThis method builds a map of filename to the configuration object defined\nby the file. The search order is:\n</p>\n<pre>\ndefault.EXT\n(hostname).EXT\n(deployment).EXT\n(hostname)-(deployment).EXT\nruntime.json\n</pre>\n<p>\nEXT can be yaml, json, or js signifying the file type. yaml is in YAML format,\njson is in strict JSON format, and js is a javascript executable file that is\nrequire()'d with module.exports being the config object.\n</p>\n<p>\n(hostname) is the $HOST environment variable if set, otherwise the\nhostname found from require('os').hostname()\n</p>\n<p>\n(deployment) is the deployment type, found in the $NODE_ENV environment\nvariable. Defaults to 'development'.\n</p>\n<p>\nThe runtime.json file contains configuration changes made at runtime either\nmanually, or by the application setting a configuration value.\n</p>", "guessedname": "_loadFileConfigs", "guessedtype": "function"}, "constructor": {"return": {"type": "object", "description": "CONFIG - The top level configuration object"}, "description": "<p>Get the configuration object.</p>\n<p>\nThe configuration object is a shared singleton object within the applicaiton,\nattained by calling require('config').\n</p>\n<p>\nUsually you'll specify a CONFIG variable at the top of your .js file\nfor file/module scope. If you want the root of the object, you can do this:\n</p>\n<pre>\nvar CONFIG = require('config');\n</pre>\n<p>\nSometimes you only care about a specific sub-object within the CONFIG\nobject. In that case you could do this at the top of your file:\n</p>\n<pre>\nvar CONFIG = require('config').customer;\nor\nvar CUSTOMER_CONFIG = require('config').customer;\n</pre>\n<script type=\"text/javascript\">\ndocument.getElementById(\"showProtected\").style.display = \"block\";\n</script>", "guessedname": "Config", "guessedtype": "function"}, "_extendDeep": {"return": {"type": "object", "description": "The altered mergeInto object is returned"}, "description": "Extend an object, and any object it contains.\nThis does not replace deep objects, but dives into them\nreplacing individual elements instead.", "protected": "", "params": [{"type": "object", "name": "mergeInto", "description": " The object to merge into"}, {"type": "object...", "name": "mergeFrom...", "description": " - Any number of objects to merge from"}, {"type": "integer", "name": "depth", "description": " An optional depth to prevent recursion. Default: 20."}], "guessedname": "_extendDeep", "guessedtype": "function"}, "_isObject": {"return": {"type": "boolean", "description": "TRUE if the arg is an object, FALSE if not"}, "description": "Is the specified argument a regular javascript object?\nThe argument is an object if it's a JS object, but not an array.", "protected": "", "params": [{"type": "MIXED", "name": "arg", "description": " An argument of any type."}], "guessedname": "_isObject", "guessedtype": "function"}, "_parseFile": {"return": {"type": "configObject", "description": "The configuration object parsed from the file"}, "description": "Parse and return the specified configuration file.\nIf the file exists in the application config directory, it will\nparse and return it as a JavaScript object.\nThe file extension determines the parser to use.\n.js = File to run that has a module.exports containing the config object\n.json = File is parsed using JSON.parse()\n.yaml = Parsed with a YAML parser\nIf the file doesn't exist, a null will be returned.\nIf the file can't be parsed, an exception will be thrown.", "protected": "", "params": [{"type": "string", "name": "fullFilename", "description": " The full file path and name"}], "guessedname": "_parseFile", "guessedtype": "function"}}, "file": "config.js", "shortname": "Config", "description": "<p>Runtime Application Configurations</p>\n<p>\nThe config module exports a singleton object representing all runtime\nconfigurations for this application deployment.\n</p>\n<p>\nApplication configurations are stored in files within the config directory\nof your application. The default configuration file is loaded, followed\nby files specific to the deployment type (development, testing, staging,\nproduction, etc.).\n</p>\n<p>\nFor example, with the following config/default.yaml file:\n</p>\n<pre>\n...\ncustomer:\n&nbsp;&nbsp;initialCredit: 500\n&nbsp;&nbsp;db:\n&nbsp;&nbsp;&nbsp;&nbsp;name: customer\n&nbsp;&nbsp;&nbsp;&nbsp;port: 5984\n...\n</pre>\n<p>\nThe following code loads the customer section into the CONFIG variable:\n<p>\n<pre>\nvar CONFIG = require('config').customer;\n...\nnewCustomer.creditLimit = CONFIG.initialCredit;\ndatabase.open(CONFIG.db.name, CONFIG.db.port);\n...\n</pre>"}, "ProtectedTest": {"name": "ProtectedTest", "namespace": "", "module": "test", "guessedname": "PrivateTest", "file": "1-protected-test.js", "guessedtype": "property", "shortname": "ProtectedTest", "description": "<p>Tests for underlying node-config utilities. To run type:</p>\n<pre>npm test config</pre>"}}, "version": "0.4.3", "modules": {"test": {"description": "<p>Unit tests</p>", "submodules": [], "classlist": ["ProtectedTest", "ConfigTest"], "filelist": ["1-protected-test.js", "2-config-test.js"], "subdata": {}, "name": "test"}, "config": {"description": "<p>Runtime Application Configurations</p>\n<p>\nThe config module exports a singleton object representing all runtime\nconfigurations for this application deployment.\n</p>\n<p>\nApplication configurations are stored in files within the config directory\nof your application. The default configuration file is loaded, followed\nby files specific to the deployment type (development, testing, staging,\nproduction, etc.).\n</p>\n<p>\nFor example, with the following config/default.yaml file:\n</p>\n<pre>\n...\ncustomer:\n&nbsp;&nbsp;initialCredit: 500\n&nbsp;&nbsp;db:\n&nbsp;&nbsp;&nbsp;&nbsp;name: customer\n&nbsp;&nbsp;&nbsp;&nbsp;port: 5984\n...\n</pre>\n<p>\nThe following code loads the customer section into the CONFIG variable:\n<p>\n<pre>\nvar CONFIG = require('config').customer;\n...\nnewCustomer.creditLimit = CONFIG.initialCredit;\ndatabase.open(CONFIG.db.name, CONFIG.db.port);\n...\n</pre>", "submodules": [], "classlist": ["Config"], "filelist": ["config.js"], "subdata": {}, "name": "config"}}, "filemap": {"2-config-test.js": {"classlist": ["ConfigTest"], "name": "2-config-test.js", "module": "test"}, "config.js": {"classlist": ["Config"], "name": "config.js", "module": "config"}, "1-protected-test.js": {"classlist": ["ProtectedTest"], "name": "1-protected-test.js", "module": "test"}}}
View
7 doc/template/overview.tmpl
@@ -151,9 +151,10 @@
</p>
<p>
If configuration values change at runtime, these changes are persisted
- into the runtime.json file within the config directory. Application
- instances monitor changes to this file to keep configuration values
- consistent among the different application instances.
+ into the runtime.json file within the config directory. Multi-node
+ application instances can keep in synch by calling the
+ <a href="Config.html#method_watchForConfigFileChanges">watchForConfigFileChanges</a>
+ method at startup.
</p>
<p>
This paradigm does not currently extend beyond a single machine.
View
29 lib/config.js 100755 → 100644
@@ -10,7 +10,8 @@ var DEFAULT_CLONE_DEPTH = 6,
runtimeJsonFilename = CONFIG_PATH + 'runtime.json',
originalConfig = null, // Not including the runtime.json values
runtimeJson = {}, // Current runtimeJson extensions
- isQueuedForPersistence = false;
+ isQueuedForPersistence = false,
+ isWatchingForConfigFileChanges = false;
/**
* <p>Runtime Application Configurations</p>
@@ -93,7 +94,6 @@ var DEFAULT_CLONE_DEPTH = 6,
var Config = function() {
var t = this;
t._loadFileConfigs();
- t._watchForConfigFileChanges();
t._persistConfigsOnChange();
};
@@ -353,26 +353,33 @@ Config.prototype.makeImmutable = function(object, property) {
};
/**
- * Monitor the filesystem for configuration file changes.
+ * Monitor the runtime.json file for configuration changes.
*
* <p>
- * Runtime configuration changes are made by modifying the runtime.json file.
- * This paradigm allows multiple application servers to internally notify
- * listeners whenever the configuration changes.
+ * Long running processes can call this method at startup to have node-config
+ * automatically monitor and apply changes made to the config/runtime.json file.
+ * </p>
+ *
+ * <p>
+ * This paradigm allows for manual changes to running application servers,
+ * and for multi-node application servers to keep in sync.
* </p>
*
* <p>
- * This method attaches the file watcher onto the runtime.json file, reloading
+ * This method attaches a file watcher onto the runtime.json file, reloading
* the file on change and merging the new values into the CONFIG object.
* </p>
*
- * @protected
- * @method _watchForConfigFileChanges
+ * @method watchForConfigFileChanges
*/
-Config.prototype._watchForConfigFileChanges = function() {
+Config.prototype.watchForConfigFileChanges = function() {
- // Attach the file watcher
+ // Only set up watching once
var t = this;
+ if (isWatchingForConfigFileChanges) return;
+ isWatchingForConfigFileChanges = true;
+
+ // Attach the file watcher
FileSystem.watchFile(runtimeJsonFilename, function(curr, prev) {
// no-op if the file hasn't changed
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "config",
- "version": "0.4.2",
+ "version": "0.4.3",
"main": "./lib/config.js",
"description": "Configuration control for production node deployments",
"modules" : { "test" : "./test" },
View
6 test/2-config-test.js
@@ -102,7 +102,7 @@ exports.ConfigTest = vows.describe('Test suite for node-config').addBatch({
}
},
- 'Change Notification Tests': {
+ 'Internal Change Notification Tests': {
topic: function() {
// Attach this topic as a watcher
@@ -143,7 +143,7 @@ exports.ConfigTest = vows.describe('Test suite for node-config').addBatch({
assert.equal(CONFIG.watchThisValue, newWatchedValue);
},
- 'waiting for O/S change notification...': function(err, obj) {
+ 'Waiting for the O/S to notify us of changes...': function(err, obj) {
// This is just a message for the next test
assert.isTrue(true);
}
@@ -158,7 +158,7 @@ exports.ConfigTest = vows.describe('Test suite for node-config').addBatch({
t.callback(null, CONFIG._parseFile(runtimeJsonFilename));
});
},
- 'The O/S notified us of the configuration file change': function(err, runtimeObj) {
+ 'The runtime.json file was changed': function(err, runtimeObj) {
assert.isTrue(!err);
},
'Prior configuration values were kept intact': function(err, runtimeObj) {
View
4 tools/gen-docs.sh
@@ -48,7 +48,7 @@ rm -rf $parser_tmp
echo Copying the documentation to ../lorenwest.github.com/node-config/$version
rm -rf ../lorenwest.github.com/node-config/$version
-cp -dR doc ../lorenwest.github.com/node-config/$version
+cp -R doc ../lorenwest.github.com/node-config/$version
echo Copying the documentation to ../lorenwest.github.com/node-config/latest
rm -rf ../lorenwest.github.com/node-config/latest
-cp -dR doc ../lorenwest.github.com/node-config/latest
+cp -R doc ../lorenwest.github.com/node-config/latest
Please sign in to comment.
Something went wrong with that request. Please try again.