3 <title>npm-install</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-install.html">npm-install</a></h1> <p>install a package programmatically</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm.commands.install([where,] packages, callback)</code></pre>
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
17 <p>This acts much the same ways as installing on the command-line.</p>
19 <p>The 'where' parameter is optional and only used internally, and it specifies
20 where the packages should be installed to.</p>
22 <p>The 'packages' parameter is an array of strings. Each element in the array is
23 the name of a package to be installed.</p>
25 <p>Finally, 'callback' is a function that will be called when all packages have been
26 installed or when an error has been encountered.</p>
28 <p id="footer">npm-install — npm@1.3.19</p>
31 var wrapper = document.getElementById("wrapper")
32 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
33 .filter(function (el) {
34 return el.parentNode === wrapper
35 && el.tagName.match(/H[1-6]/)
39 , toc = document.createElement("ul")
40 toc.innerHTML = els.map(function (el) {
41 var i = el.tagName.charAt(1)
51 out += "<li><a href='#" + el.id + "'>" +
52 ( el.innerText || el.text || el.innerHTML)
57 document.body.appendChild(toc)