npm: Upgrade to 1.3.19
[platform/upstream/nodejs.git] / deps / npm / html / doc / api / npm-run-script.html
1 <!doctype html>
2 <html>
3   <title>npm-run-script</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="../api/npm-run-script.html">npm-run-script</a></h1> <p>Run arbitrary package scripts</p>
10
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
12
13 <pre><code>npm.commands.run-script(args, callback)</code></pre>
14
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
16
17 <p>This runs an arbitrary command from a package&#39;s &quot;scripts&quot; object.</p>
18
19 <p>It is used by the test, start, restart, and stop commands, but can be
20 called directly, as well.</p>
21
22 <p>The &#39;args&#39; parameter is an array of strings. Behavior depends on the number
23 of elements.  If there is only one element, npm assumes that the element
24 represents a command to be run on the local repository. If there is more than
25 one element, then the first is assumed to be the package and the second is
26 assumed to be the command to run. All other elements are ignored.</p>
27
28 <h2 id="SEE-ALSO">SEE ALSO</h2>
29
30 <ul><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../api/npm-test.html">npm-test(3)</a></li><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-restart.html">npm-restart(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
31 </div>
32 <p id="footer">npm-run-script &mdash; npm@1.3.19</p>
33 <script>
34 ;(function () {
35 var wrapper = document.getElementById("wrapper")
36 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
37   .filter(function (el) {
38     return el.parentNode === wrapper
39         && el.tagName.match(/H[1-6]/)
40         && el.id
41   })
42 var l = 2
43   , toc = document.createElement("ul")
44 toc.innerHTML = els.map(function (el) {
45   var i = el.tagName.charAt(1)
46     , out = ""
47   while (i > l) {
48     out += "<ul>"
49     l ++
50   }
51   while (i < l) {
52     out += "</ul>"
53     l --
54   }
55   out += "<li><a href='#" + el.id + "'>" +
56     ( el.innerText || el.text || el.innerHTML)
57     + "</a>"
58   return out
59 }).join("\n")
60 toc.id = "toc"
61 document.body.appendChild(toc)
62 })()
63 </script>