From 3b104f2026d524b5eab4fc605f3390251778b137 Mon Sep 17 00:00:00 2001
From: indexzero type
.
Responds with an Object representing all keys associated in this instance.
nconf.load = function (callback) {
+Responds with an Object representing all keys associated in this instance.
nconf.load = function (callback) {
If we don't have a callback and the current +store is capable of loading synchronously +then do so.
if (!callback && nconf.store.loadSync) {
+ return nconf.store.loadSync();
+ }
+
+
if (!nconf.store.load) {
var error = new Error('nconf store ' + nconf.store.type + ' has no load() method');
if (callback) {
@@ -59,7 +65,7 @@ specified type
.
value
.
if (!callback) {
callback = value;
value = null;
+ If we still don't have a callback and the +current store is capable of saving synchronously +then do so.
if (!callback && nconf.store.saveSync) {
+ return nconf.store.saveSync();
+ }
}
if (!nconf.store.save) {
@@ -82,22 +93,22 @@ instance and then adds all key-value pairs in value
.
}
return nconf.store.save(value, callback);
-};
Clears all keys associated with this instance.
nconf.reset = function (callback) {
return nconf.store.reset(callback);
-};
Returns a :
joined string from the arguments
.
nconf.key = function () {
return Array.prototype.slice.call(arguments).join(':');
-};
Returns a fully-qualified path to a nested nconf key.
nconf.path = function (key) {
return key.split(':');
-};
Use the memory
engine by default
nconf.use('memory');
+};
Use the memory
engine by default
nconf.use('memory');