3 <title>npm-root</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-root.html">npm-root</a></h1> <p>Display npm root</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm.commands.root(args, callback)</code></pre>
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
17 <p>Print the effective <code>node_modules</code> folder to standard out.</p>
19 <p>'args' is never used and callback is never called with data.
20 'args' must be present or things will break.</p>
22 <p>This function is not useful programmatically.</p>
24 <p id="footer">npm-root — npm@1.3.17</p>
27 var wrapper = document.getElementById("wrapper")
28 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
29 .filter(function (el) {
30 return el.parentNode === wrapper
31 && el.tagName.match(/H[1-6]/)
35 , toc = document.createElement("ul")
36 toc.innerHTML = els.map(function (el) {
37 var i = el.tagName.charAt(1)
47 out += "<li><a href='#" + el.id + "'>" +
48 ( el.innerText || el.text || el.innerHTML)
53 document.body.appendChild(toc)