You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
2.0 KiB

<!doctype html>
<html>
<title>help-search</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="./style.css">
<body>
<div id="wrapper">
<h1><a href="../api/help-search.html">help-search</a></h1> <p>Search the help pages</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>npm.commands.helpSearch(args, [silent,] callback)</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This command is rarely useful, but it exists in the rare case that it is.</p>
<p>This command takes an array of search terms and returns the help pages that
match in order of best match.</p>
<p>If there is only one match, then npm displays that help section. If there
are multiple results, the results are printed to the screen formatted and the
array of results is returned. Each result is an object with these properties:</p>
<ul><li>hits:
A map of args to number of hits on that arg. For example, {"npm": 3}</li><li>found:
Total number of unique args that matched.</li><li>totalHits:
Total number of hits.</li><li>lines:
An array of all matching lines (and some adjacent lines).</li><li>file:
Name of the file that matched</li></ul>
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
<p id="footer">help-search &mdash; npm@1.1.0-alpha-6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
.filter(function (el) {
return el.parentNode === wrapper
&& el.tagName.match(/H[1-6]/)
&& el.id
})
var l = 2
, toc = document.createElement("ul")
toc.innerHTML = els.map(function (el) {
var i = el.tagName.charAt(1)
, out = ""
while (i > l) {
out += "<ul>"
l ++
}
while (i < l) {
out += "</ul>"
l --
}
out += "<li><a href='#" + el.id + "'>" +
( el.innerText || el.text || el.innerHTML)
+ "</a>"
return out
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
</script>
</body></html>