The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.
Please select the desired protocol below to get the URL.
This URL has Read-Only access.
main_repo / deps / npm / html / api / run-script.html @ 5aef65a9
History | View | Annotate | Download (2.03 KB)
1 |
<!doctype html>
|
---|---|
2 |
<html>
|
3 |
<title>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/run-script.html">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's "scripts" 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 'args' 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="../doc/scripts.html">scripts(1)</a></li><li><a href="../api/test.html">test(3)</a></li><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/restart.html">restart(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul> |
31 |
</div>
|
32 |
<p id="footer">run-script — npm@1.2.10</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>
|
64 |
</body></html> |