npm: Upgrade to v1.3.22
[platform/upstream/nodejs.git] / deps / npm / html / doc / api / npm-search.html
1 <!doctype html>
2 <html>
3   <title>npm-search</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-search.html">npm-search</a></h1> <p>Search for packages</p>
10
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
12
13 <pre><code>npm.commands.search(searchTerms, [silent,] [staleness,] callback)</code></pre>
14
15 <h2 id="DESCRIPTION">DESCRIPTION</h2>
16
17 <p>Search the registry for packages matching the search terms. The available parameters are:</p>
18
19 <ul><li>searchTerms:
20 Array of search terms. These terms are case-insensitive.</li><li>silent:
21 If true, npm will not log anything to the console.</li><li>staleness:
22 This is the threshold for stale packages. &quot;Fresh&quot; packages are not refreshed
23 from the registry. This value is measured in seconds.</li><li><p>callback:
24 Returns an object where each key is the name of a package, and the value
25 is information about that package along with a &#39;words&#39; property, which is
26 a space-delimited string of all of the interesting words in that package.
27 The only properties included are those that are searched, which generally include:</p><ul><li>name</li><li>description</li><li>maintainers</li><li>url</li><li>keywords</li></ul></li></ul>
28
29 <p>A search on the registry excludes any result that does not match all of the
30 search terms. It also removes any items from the results that contain an
31 excluded term (the &quot;searchexclude&quot; config). The search is case insensitive
32 and doesn&#39;t try to read your mind (it doesn&#39;t do any verb tense matching or the
33 like).</p>
34 </div>
35 <p id="footer">npm-search &mdash; npm@1.3.22</p>
36 <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>