nconf-lite/docs/nconf/formats.html
2011-09-18 21:39:13 -04:00

22 lines
No EOL
4.7 KiB
HTML

<!DOCTYPE html> <html> <head> <title>formats.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="..//nconf/common.html"> nconf/common.html </a> <a class="source" href="..//nconf/formats.html"> nconf/formats.html </a> <a class="source" href="..//nconf/provider.html"> nconf/provider.html </a> <a class="source" href="..//nconf/stores/file.html"> nconf/stores/file.html </a> <a class="source" href="..//nconf/stores/memory.html"> nconf/stores/memory.html </a> <a class="source" href="..//nconf/stores/system.html"> nconf/stores/system.html </a> <a class="source" href="..//nconf/stores.html"> nconf/stores.html </a> <a class="source" href="..//nconf.html"> nconf.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> formats.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
<span class="cm"> * formats.js: Default formats supported by nconf</span>
<span class="cm"> *</span>
<span class="cm"> * (C) 2011, Charlie Robbins</span>
<span class="cm"> *</span>
<span class="cm"> */</span>
<span class="kd">var</span> <span class="nx">ini</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;ini&#39;</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">formats</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h3>@json</h3>
<p>Standard JSON format which pretty prints <code>.stringify()</code>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">formats</span><span class="p">.</span><span class="nx">json</span> <span class="o">=</span> <span class="p">{</span>
<span class="nx">stringify</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="p">},</span>
<span class="nx">parse</span><span class="o">:</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span>
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h3>@ini</h3>
<p>Standard INI format supplied from the <code>ini</code> module
http://en.wikipedia.org/wiki/INI_file</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">formats</span><span class="p">.</span><span class="nx">ini</span> <span class="o">=</span> <span class="nx">ini</span><span class="p">;</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>