3 <title>npm-config</title>
4 <meta http-equiv="content-type" value="text/html;utf-8">
5 <link rel="stylesheet" type="text/css" href="../../static/style.css">
9 <h1><a href="../api/npm-config.html">npm-config</a></h1> <p>Manage the npm configuration files</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm.commands.config(args, callback)
14 var val = npm.config.get(key)
15 npm.config.set(key, val)</code></pre>
17 <h2 id="DESCRIPTION">DESCRIPTION</h2>
19 <p>This function acts much the same way as the command-line version. The first
20 element in the array tells config what to do. Possible values are:</p>
22 <ul><li><p><code>set</code></p><p>Sets a config parameter. The second element in <code>args</code> is interpreted as the
23 key, and the third element is interpreted as the value.</p></li><li><p><code>get</code></p><p>Gets the value of a config parameter. The second element in <code>args</code> is the
24 key to get the value of.</p></li><li><p><code>delete</code> (<code>rm</code> or <code>del</code>)</p><p>Deletes a parameter from the config. The second element in <code>args</code> is the
25 key to delete.</p></li><li><p><code>list</code> (<code>ls</code>)</p><p>Show all configs that aren't secret. No parameters necessary.</p></li><li><p><code>edit</code>:</p><p>Opens the config file in the default editor. This command isn't very useful
26 programmatically, but it is made available.</p></li></ul>
28 <p>To programmatically access npm configuration settings, or set them for
29 the duration of a program, use the <code>npm.config.set</code> and <code>npm.config.get</code>
30 functions instead.</p>
32 <h2 id="SEE-ALSO">SEE ALSO</h2>
34 <ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
36 <p id="footer">npm-config — npm@1.3.19</p>
39 var wrapper = document.getElementById("wrapper")
40 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
41 .filter(function (el) {
42 return el.parentNode === wrapper
43 && el.tagName.match(/H[1-6]/)
47 , toc = document.createElement("ul")
48 toc.innerHTML = els.map(function (el) {
49 var i = el.tagName.charAt(1)
59 out += "<li><a href='#" + el.id + "'>" +
60 ( el.innerText || el.text || el.innerHTML)
65 document.body.appendChild(toc)