npm-search.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <html><head>
  2. <title>npm-search</title>
  3. <style>
  4. body {
  5. background-color: #ffffff;
  6. color: #24292e;
  7. margin: 0;
  8. line-height: 1.5;
  9. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  10. }
  11. #rainbar {
  12. height: 10px;
  13. background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
  14. }
  15. a {
  16. text-decoration: none;
  17. color: #0366d6;
  18. }
  19. a:hover {
  20. text-decoration: underline;
  21. }
  22. pre {
  23. margin: 1em 0px;
  24. padding: 1em;
  25. border: solid 1px #e1e4e8;
  26. border-radius: 6px;
  27. display: block;
  28. overflow: auto;
  29. white-space: pre;
  30. background-color: #f6f8fa;
  31. color: #393a34;
  32. }
  33. code {
  34. font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
  35. font-size: 85%;
  36. padding: 0.2em 0.4em;
  37. background-color: #f6f8fa;
  38. color: #393a34;
  39. }
  40. pre > code {
  41. padding: 0;
  42. background-color: inherit;
  43. color: inherit;
  44. }
  45. h1, h2, h3 {
  46. font-weight: 600;
  47. }
  48. #logobar {
  49. background-color: #333333;
  50. margin: 0 auto;
  51. padding: 1em 4em;
  52. }
  53. #logobar .logo {
  54. float: left;
  55. }
  56. #logobar .title {
  57. font-weight: 600;
  58. color: #dddddd;
  59. float: left;
  60. margin: 5px 0 0 1em;
  61. }
  62. #logobar:after {
  63. content: "";
  64. display: block;
  65. clear: both;
  66. }
  67. #content {
  68. margin: 0 auto;
  69. padding: 0 4em;
  70. }
  71. #table_of_contents > h2 {
  72. font-size: 1.17em;
  73. }
  74. #table_of_contents ul:first-child {
  75. border: solid 1px #e1e4e8;
  76. border-radius: 6px;
  77. padding: 1em;
  78. background-color: #f6f8fa;
  79. color: #393a34;
  80. }
  81. #table_of_contents ul {
  82. list-style-type: none;
  83. padding-left: 1.5em;
  84. }
  85. #table_of_contents li {
  86. font-size: 0.9em;
  87. }
  88. #table_of_contents li a {
  89. color: #000000;
  90. }
  91. header.title {
  92. border-bottom: solid 1px #e1e4e8;
  93. }
  94. header.title > h1 {
  95. margin-bottom: 0.25em;
  96. }
  97. header.title > .description {
  98. display: block;
  99. margin-bottom: 0.5em;
  100. line-height: 1;
  101. }
  102. footer#edit {
  103. border-top: solid 1px #e1e4e8;
  104. margin: 3em 0 4em 0;
  105. padding-top: 2em;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <div id="banner">
  111. <div id="rainbar"></div>
  112. <div id="logobar">
  113. <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
  114. <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
  115. <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
  116. </svg>
  117. <div class="title">
  118. npm command-line interface
  119. </div>
  120. </div>
  121. </div>
  122. <section id="content">
  123. <header class="title">
  124. <h1 id="npm-search">npm-search</h1>
  125. <span class="description">Search for packages</span>
  126. </header>
  127. <section id="table_of_contents">
  128. <h2 id="table-of-contents">Table of contents</h2>
  129. <div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#long"><code>long</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#searchopts"><code>searchopts</code></a></li><li><a href="#searchexclude"><code>searchexclude</code></a></li><li><a href="#registry"><code>registry</code></a></li><li><a href="#prefer-online"><code>prefer-online</code></a></li><li><a href="#prefer-offline"><code>prefer-offline</code></a></li><li><a href="#offline"><code>offline</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
  130. </section>
  131. <div id="_content"><h3 id="synopsis">Synopsis</h3>
  132. <pre lang="bash"><code>npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
  133. aliases: s, se, find
  134. </code></pre>
  135. <p>Note: This command is unaware of workspaces.</p>
  136. <h3 id="description">Description</h3>
  137. <p>Search the registry for packages matching the search terms. <code>npm search</code>
  138. performs a linear, incremental, lexically-ordered search through package
  139. metadata for all files in the registry. If your terminal has color
  140. support, it will further highlight the matches in the results. This can
  141. be disabled with the config item <code>color</code></p>
  142. <p>Additionally, using the <code>--searchopts</code> and <code>--searchexclude</code> options
  143. paired with more search terms will include and exclude further patterns.
  144. The main difference between <code>--searchopts</code> and the standard search terms
  145. is that the former does not highlight results in the output and you can
  146. use them more fine-grained filtering. Additionally, you can add both of
  147. these to your config to change default search filtering behavior.</p>
  148. <p>Search also allows targeting of maintainers in search results, by prefixing
  149. their npm username with <code>=</code>.</p>
  150. <p>If a term starts with <code>/</code>, then it’s interpreted as a regular expression
  151. and supports standard JavaScript RegExp syntax. In this case search will
  152. ignore a trailing <code>/</code> . (Note you must escape or quote many regular
  153. expression characters in most shells.)</p>
  154. <h3 id="configuration">Configuration</h3>
  155. <!-- raw HTML omitted -->
  156. <!-- raw HTML omitted -->
  157. <!-- raw HTML omitted -->
  158. <h4 id="long"><code>long</code></h4>
  159. <ul>
  160. <li>Default: false</li>
  161. <li>Type: Boolean</li>
  162. </ul>
  163. <p>Show extended information in <code>ls</code>, <code>search</code>, and <code>help-search</code>.</p>
  164. <!-- raw HTML omitted -->
  165. <!-- raw HTML omitted -->
  166. <h4 id="json"><code>json</code></h4>
  167. <ul>
  168. <li>Default: false</li>
  169. <li>Type: Boolean</li>
  170. </ul>
  171. <p>Whether or not to output JSON data, rather than the normal output.</p>
  172. <ul>
  173. <li>In <code>npm pkg set</code> it enables parsing set values with JSON.parse() before
  174. saving them to your <code>package.json</code>.</li>
  175. </ul>
  176. <p>Not supported by all npm commands.</p>
  177. <!-- raw HTML omitted -->
  178. <!-- raw HTML omitted -->
  179. <h4 id="color"><code>color</code></h4>
  180. <ul>
  181. <li>Default: true unless the NO_COLOR environ is set to something other than ‘0’</li>
  182. <li>Type: “always” or Boolean</li>
  183. </ul>
  184. <p>If false, never shows colors. If <code>"always"</code> then always shows colors. If
  185. true, then only prints color codes for tty file descriptors.</p>
  186. <!-- raw HTML omitted -->
  187. <!-- raw HTML omitted -->
  188. <h4 id="parseable"><code>parseable</code></h4>
  189. <ul>
  190. <li>Default: false</li>
  191. <li>Type: Boolean</li>
  192. </ul>
  193. <p>Output parseable results from commands that write to standard output. For
  194. <code>npm search</code>, this will be tab-separated table format.</p>
  195. <!-- raw HTML omitted -->
  196. <!-- raw HTML omitted -->
  197. <h4 id="description2"><code>description</code></h4>
  198. <ul>
  199. <li>Default: true</li>
  200. <li>Type: Boolean</li>
  201. </ul>
  202. <p>Show the description in <code>npm search</code></p>
  203. <!-- raw HTML omitted -->
  204. <!-- raw HTML omitted -->
  205. <h4 id="searchopts"><code>searchopts</code></h4>
  206. <ul>
  207. <li>Default: “”</li>
  208. <li>Type: String</li>
  209. </ul>
  210. <p>Space-separated options that are always passed to search.</p>
  211. <!-- raw HTML omitted -->
  212. <!-- raw HTML omitted -->
  213. <h4 id="searchexclude"><code>searchexclude</code></h4>
  214. <ul>
  215. <li>Default: “”</li>
  216. <li>Type: String</li>
  217. </ul>
  218. <p>Space-separated options that limit the results from search.</p>
  219. <!-- raw HTML omitted -->
  220. <!-- raw HTML omitted -->
  221. <h4 id="registry"><code>registry</code></h4>
  222. <ul>
  223. <li>Default: “<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a>”</li>
  224. <li>Type: URL</li>
  225. </ul>
  226. <p>The base URL of the npm registry.</p>
  227. <!-- raw HTML omitted -->
  228. <!-- raw HTML omitted -->
  229. <h4 id="prefer-online"><code>prefer-online</code></h4>
  230. <ul>
  231. <li>Default: false</li>
  232. <li>Type: Boolean</li>
  233. </ul>
  234. <p>If true, staleness checks for cached data will be forced, making the CLI
  235. look for updates immediately even for fresh package data.</p>
  236. <!-- raw HTML omitted -->
  237. <!-- raw HTML omitted -->
  238. <h4 id="prefer-offline"><code>prefer-offline</code></h4>
  239. <ul>
  240. <li>Default: false</li>
  241. <li>Type: Boolean</li>
  242. </ul>
  243. <p>If true, staleness checks for cached data will be bypassed, but missing data
  244. will be requested from the server. To force full offline mode, use
  245. <code>--offline</code>.</p>
  246. <!-- raw HTML omitted -->
  247. <!-- raw HTML omitted -->
  248. <h4 id="offline"><code>offline</code></h4>
  249. <ul>
  250. <li>Default: false</li>
  251. <li>Type: Boolean</li>
  252. </ul>
  253. <p>Force offline mode: no network requests will be done during install. To
  254. allow the CLI to fill in missing cache data, see <code>--prefer-offline</code>.</p>
  255. <!-- raw HTML omitted -->
  256. <!-- raw HTML omitted -->
  257. <!-- raw HTML omitted -->
  258. <h3 id="see-also">See Also</h3>
  259. <ul>
  260. <li><a href="../using-npm/registry.html">npm registry</a></li>
  261. <li><a href="../commands/npm-config.html">npm config</a></li>
  262. <li><a href="../configuring-npm/npmrc.html">npmrc</a></li>
  263. <li><a href="../commands/npm-view.html">npm view</a></li>
  264. <li><a href="../commands/npm-cache.html">npm cache</a></li>
  265. <li><a href="https://npm.im/npm-registry-fetch">https://npm.im/npm-registry-fetch</a></li>
  266. </ul>
  267. </div>
  268. <footer id="edit">
  269. <a href="https://github.com/npm/cli/edit/latest/docs/content/commands/npm-search.md">
  270. <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
  271. <path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
  272. </svg>
  273. Edit this page on GitHub
  274. </a>
  275. </footer>
  276. </section>
  277. </body></html>