811adc5d60942476f6cbbb72250db160f4253ab4
[platform/upstream/nodejs.git] / deps / npm / html / doc / cli / npm-completion.html
1 <!doctype html>
2 <html>
3   <title>npm-completion</title>
4   <meta http-equiv="content-type" value="text/html;utf-8">
5   <link rel="stylesheet" type="text/css" href="../../static/style.css">
6
7   <body>
8     <div id="wrapper">
9 <h1><a href="../cli/npm-completion.html">npm-completion</a></h1> <p>Tab Completion for npm</p>
10
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
12
13 <pre><code>. &lt;(npm completion)</code></pre>
14
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
16
17 <p>Enables tab-completion in all npm commands.</p>
18
19 <p>The synopsis above
20 loads the completions into your current shell.  Adding it to
21 your ~/.bashrc or ~/.zshrc will make the completions available
22 everywhere.</p>
23
24 <p>You may of course also pipe the output of npm completion to a file
25 such as <code>/usr/local/etc/bash_completion.d/npm</code> if you have a system
26 that will read that file for you.</p>
27
28 <p>When <code>COMP_CWORD</code>, <code>COMP_LINE</code>, and <code>COMP_POINT</code> are defined in the
29 environment, <code>npm completion</code> acts in &quot;plumbing mode&quot;, and outputs
30 completions based on the arguments.</p>
31
32 <h2 id="SEE-ALSO">SEE ALSO</h2>
33
34 <ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
35 </div>
36 <p id="footer">npm-completion &mdash; npm@1.3.17</p>
37 <script>
38 ;(function () {
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]/)
44         && el.id
45   })
46 var l = 2
47   , toc = document.createElement("ul")
48 toc.innerHTML = els.map(function (el) {
49   var i = el.tagName.charAt(1)
50     , out = ""
51   while (i > l) {
52     out += "<ul>"
53     l ++
54   }
55   while (i < l) {
56     out += "</ul>"
57     l --
58   }
59   out += "<li><a href='#" + el.id + "'>" +
60     ( el.innerText || el.text || el.innerHTML)
61     + "</a>"
62   return out
63 }).join("\n")
64 toc.id = "toc"
65 document.body.appendChild(toc)
66 })()
67 </script>