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-ls.html">npm-ls</a></h1> <p>List installed packages</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm.commands.ls(args, [silent,] callback)</code></pre>
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
17 <p>This command will print to stdout all the versions of packages that are
18 installed, as well as their dependencies, in a tree-structure. It will also
19 return that data using the callback.</p>
21 <p>This command does not take any arguments, but args must be defined.
22 Beyond that, if any arguments are passed in, npm will politely warn that it
23 does not take positional arguments, though you may set config flags
24 like with any other command, such as <code>global</code> to list global packages.</p>
26 <p>It will print out extraneous, missing, and invalid packages.</p>
28 <p>If the silent parameter is set to true, nothing will be output to the screen,
29 but the data will still be returned.</p>
31 <p>Callback is provided an error if one occurred, the full data about which
32 packages are installed and which dependencies they will receive, and a
33 "lite" data object which just shows which versions are installed where.
34 Note that the full data object is a circular structure, so care must be
35 taken if it is serialized to JSON.</p>
37 <h2 id="CONFIGURATION">CONFIGURATION</h2>
39 <h3 id="long">long</h3>
41 <ul><li>Default: false</li><li>Type: Boolean</li></ul>
43 <p>Show extended information.</p>
45 <h3 id="parseable">parseable</h3>
47 <ul><li>Default: false</li><li>Type: Boolean</li></ul>
49 <p>Show parseable output instead of tree view.</p>
51 <h3 id="global">global</h3>
53 <ul><li>Default: false</li><li>Type: Boolean</li></ul>
55 <p>List packages in the global install prefix instead of in the current
58 <p>Note, if parseable is set or long isn't set, then duplicates will be trimmed.
59 This means that if a submodule a same dependency as a parent module, then the
60 dependency will only be output once.</p>
62 <p id="footer">npm-ls — npm@1.3.15</p>
65 var wrapper = document.getElementById("wrapper")
66 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
67 .filter(function (el) {
68 return el.parentNode === wrapper
69 && el.tagName.match(/H[1-6]/)
73 , toc = document.createElement("ul")
74 toc.innerHTML = els.map(function (el) {
75 var i = el.tagName.charAt(1)
85 out += "<li><a href='#" + el.id + "'>" +
86 ( el.innerText || el.text || el.innerHTML)
91 document.body.appendChild(toc)