<h4>@options {Object} Options for this instance.</h4>
<p>Constructor function for the Provider object responsible
for exposing the pluggable storage features of <code>nconf</code>.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="kd">var</span><spanclass="nx">Provider</span><spanclass="o">=</span><spanclass="nx">exports</span><spanclass="p">.</span><spanclass="nx">Provider</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">options</span><spanclass="p">)</span><spanclass="p">{</span>
<spanclass="p">};</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-3">¶</a></div><h3>function use (type, options)</h3>
<h4>@type {string} Type of the nconf store to use.</h4>
<h4>@options {Object} Options for the store instance.</h4>
<p>Sets the active <code>this.store</code> to a new instance of the
<spanclass="p">};</span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-4">¶</a></div><h3>function get (key, callback)</h3>
<h4>@key {string} Key to retrieve for this instance.</h4>
<h4>@callback {function} <strong>Optional</strong> Continuation to respond to when complete.</h4>
<p>Retrieves the value for the specified key (if any).</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">Provider</span><spanclass="p">.</span><spanclass="nx">prototype</span><spanclass="p">.</span><spanclass="nx">get</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">key</span><spanclass="p">,</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="p">{</span>
<spanclass="p">};</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-5">¶</a></div><h3>function set (key, value, callback)</h3>
<h4>@key {string} Key to set in this instance</h4>
<h4>@value {literal|Object} Value for the specified key</h4>
<h4>@callback {function} <strong>Optional</strong> Continuation to respond to when complete.</h4>
<p>Sets the <code>value</code> for the specified <code>key</code> in this instance.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">Provider</span><spanclass="p">.</span><spanclass="nx">prototype</span><spanclass="p">.</span><spanclass="nx">set</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">key</span><spanclass="p">,</span><spanclass="nx">value</span><spanclass="p">,</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="p">{</span>
<h4>@key {string} Key to remove from this instance</h4>
<h4>@callback {function} <strong>Optional</strong> Continuation to respond to when complete.</h4>
<p>Removes the value for the specified <code>key</code> from this instance.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">Provider</span><spanclass="p">.</span><spanclass="nx">prototype</span><spanclass="p">.</span><spanclass="nx">clear</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">key</span><spanclass="p">,</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="p">{</span>
<h4>@callback {function} Continuation to respond to when complete.</h4>
<p>Responds with an Object representing all keys associated in this instance.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">Provider</span><spanclass="p">.</span><spanclass="nx">prototype</span><spanclass="p">.</span><spanclass="nx">load</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="p">{</span></pre></div></td></tr><trid="section-9"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-9">¶</a></div><p>If we don't have a callback and the current
store is capable of loading synchronously
then do so.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="k">if</span><spanclass="p">(</span><spanclass="o">!</span><spanclass="nx">callback</span><spanclass="o">&&</span><spanclass="k">this</span><spanclass="p">.</span><spanclass="nx">store</span><spanclass="p">.</span><spanclass="nx">loadSync</span><spanclass="p">)</span><spanclass="p">{</span>
<spanclass="kd">var</span><spanclass="nx">error</span><spanclass="o">=</span><spanclass="k">new</span><spanclass="nb">Error</span><spanclass="p">(</span><spanclass="s1">'nconf store '</span><spanclass="o">+</span><spanclass="k">this</span><spanclass="p">.</span><spanclass="nx">store</span><spanclass="p">.</span><spanclass="nx">type</span><spanclass="o">+</span><spanclass="s1">' has no load() method'</span><spanclass="p">);</span>
<spanclass="p">};</span></pre></div></td></tr><trid="section-10"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-10">¶</a></div><h3>function save (value, callback)</h3>
<h4>@value {Object} <strong>Optional</strong> Config object to set for this instance</h4>
<h4>@callback {function} Continuation to respond to when complete.</h4>
<p>Removes any existing configuration settings that may exist in this
instance and then adds all key-value pairs in <code>value</code>. </p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">Provider</span><spanclass="p">.</span><spanclass="nx">prototype</span><spanclass="p">.</span><spanclass="nx">save</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">value</span><spanclass="p">,</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="p">{</span>
</pre></div></td></tr><trid="section-11"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-11">¶</a></div><p>If we still don't have a callback and the
current store is capable of saving synchronously
then do so.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="k">if</span><spanclass="p">(</span><spanclass="o">!</span><spanclass="nx">callback</span><spanclass="o">&&</span><spanclass="k">this</span><spanclass="p">.</span><spanclass="nx">store</span><spanclass="p">.</span><spanclass="nx">saveSync</span><spanclass="p">)</span><spanclass="p">{</span>
<spanclass="kd">var</span><spanclass="nx">error</span><spanclass="o">=</span><spanclass="k">new</span><spanclass="nb">Error</span><spanclass="p">(</span><spanclass="s1">'nconf store '</span><spanclass="o">+</span><spanclass="k">this</span><spanclass="p">.</span><spanclass="nx">store</span><spanclass="p">.</span><spanclass="nx">type</span><spanclass="o">+</span><spanclass="s1">' has no save() method'</span><spanclass="p">);</span>
<h4>@callback {function} <strong>Optional</strong> Continuation to respond to when complete.</h4>
<p>Clears all keys associated with this instance.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">Provider</span><spanclass="p">.</span><spanclass="nx">prototype</span><spanclass="p">.</span><spanclass="nx">reset</span><spanclass="o">=</span><spanclass="kd">function</span><spanclass="p">(</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="p">{</span>