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.

Statistics
| Branch: | Revision:

main_repo / deps / npm / html / doc / api / npm-help-search.html @ 5e865191

History | View | Annotate | Download (2.01 KB)

1 e85a95df isaacs
<!doctype html>
2
<html>
3 ff8a4058 isaacs
  <title>npm-help-search</title>
4 e85a95df isaacs
  <meta http-equiv="content-type" value="text/html;utf-8">
5 ff8a4058 isaacs
  <link rel="stylesheet" type="text/css" href="../../static/style.css">
6 e85a95df isaacs
7
  <body>
8
    <div id="wrapper">
9 ff8a4058 isaacs
<h1><a href="../api/npm-help-search.html">npm-help-search</a></h1> <p>Search the help pages</p>
10 e85a95df isaacs
11
<h2 id="SYNOPSIS">SYNOPSIS</h2>
12
13
<pre><code>npm.commands.helpSearch(args, [silent,] callback)</code></pre>
14
15
<h2 id="DESCRIPTION">DESCRIPTION</h2>
16
17
<p>This command is rarely useful, but it exists in the rare case that it is.</p>
18
19
<p>This command takes an array of search terms and returns the help pages that
20
match in order of best match.</p>
21
22
<p>If there is only one match, then npm displays that help section. If there
23
are multiple results, the results are printed to the screen formatted and the
24
array of results is returned. Each result is an object with these properties:</p>
25
26
<ul><li>hits:
27 caf69aa9 isaacs
A map of args to number of hits on that arg. For example, {&quot;npm&quot;: 3}</li><li>found:
28 e85a95df isaacs
Total number of unique args that matched.</li><li>totalHits:
29
Total number of hits.</li><li>lines:
30
An array of all matching lines (and some adjacent lines).</li><li>file:
31
Name of the file that matched</li></ul>
32
33
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
34
</div>
35 5e865191 isaacs
<p id="footer">npm-help-search &mdash; npm@1.3.4</p>
36 e85a95df isaacs
<script>
37
;(function () {
38
var wrapper = document.getElementById("wrapper")
39
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
40
  .filter(function (el) {
41
    return el.parentNode === wrapper
42
        && el.tagName.match(/H[1-6]/)
43
        && el.id
44
  })
45
var l = 2
46
  , toc = document.createElement("ul")
47
toc.innerHTML = els.map(function (el) {
48
  var i = el.tagName.charAt(1)
49
    , out = ""
50
  while (i > l) {
51
    out += "<ul>"
52
    l ++
53
  }
54
  while (i < l) {
55
    out += "</ul>"
56
    l --
57
  }
58
  out += "<li><a href='#" + el.id + "'>" +
59
    ( el.innerText || el.text || el.innerHTML)
60
    + "</a>"
61
  return out
62
}).join("\n")
63
toc.id = "toc"
64
document.body.appendChild(toc)
65
})()
66
</script>