npm-search.1 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. .TH "NPM\-SEARCH" "1" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-search\fR \- Search for packages
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm search [\-l|\-\-long] [\-\-json] [\-\-parseable] [\-\-no\-description] [search terms \.\.\.]
  9. aliases: s, se, find
  10. .fi
  11. .RE
  12. .SS Description
  13. .P
  14. Search the registry for packages matching the search terms\. \fBnpm search\fP
  15. performs a linear, incremental, lexically\-ordered search through package
  16. metadata for all files in the registry\. If color is enabled, it will further
  17. highlight the matches in the results\.
  18. .P
  19. Additionally, using the \fB\-\-searchopts\fP and \fB\-\-searchexclude\fP options paired with
  20. more search terms will respectively include and exclude further patterns\. The
  21. main difference between \fB\-\-searchopts\fP and the standard search terms is that the
  22. former does not highlight results in the output and can be used for more
  23. fine\-grained filtering\. Additionally, both of these can be added to \fB\|\.npmrc\fP for
  24. default search filtering behavior\.
  25. .P
  26. Search also allows targeting of maintainers in search results, by prefixing
  27. their npm username with \fB=\fP\|\.
  28. .P
  29. If a term starts with \fB/\fP, then it's interpreted as a regular expression and
  30. supports standard JavaScript RegExp syntax\. A trailing \fB/\fP will be ignored in
  31. this case\. (Note that many regular expression characters must be escaped or
  32. quoted in most shells\.)
  33. .SS A Note on caching
  34. .SS Configuration
  35. .SS description
  36. .RS 0
  37. .IP \(bu 2
  38. Default: true
  39. .IP \(bu 2
  40. Type: Boolean
  41. .RE
  42. .P
  43. Used as \fB\-\-no\-description\fP, disables search matching in package descriptions and
  44. suppresses display of that field in results\.
  45. .SS json
  46. .RS 0
  47. .IP \(bu 2
  48. Default: false
  49. .IP \(bu 2
  50. Type: Boolean
  51. .RE
  52. .P
  53. Output search results as a JSON array\.
  54. .SS parseable
  55. .RS 0
  56. .IP \(bu 2
  57. Default: false
  58. .IP \(bu 2
  59. Type: Boolean
  60. .RE
  61. .P
  62. Output search results as lines with tab\-separated columns\.
  63. .SS long
  64. .RS 0
  65. .IP \(bu 2
  66. Default: false
  67. .IP \(bu 2
  68. Type: Boolean
  69. .RE
  70. .P
  71. Display full package descriptions and other long text across multiple
  72. lines\. When disabled (default) search results are truncated to fit
  73. neatly on a single line\. Modules with extremely long names will
  74. fall on multiple lines\.
  75. .SS searchopts
  76. .RS 0
  77. .IP \(bu 2
  78. Default: ""
  79. .IP \(bu 2
  80. Type: String
  81. .RE
  82. .P
  83. Space\-separated options that are always passed to search\.
  84. .SS searchexclude
  85. .RS 0
  86. .IP \(bu 2
  87. Default: ""
  88. .IP \(bu 2
  89. Type: String
  90. .RE
  91. .P
  92. Space\-separated options that limit the results from search\.
  93. .SS searchstaleness
  94. .RS 0
  95. .IP \(bu 2
  96. Default: 900 (15 minutes)
  97. .IP \(bu 2
  98. Type: Number
  99. .RE
  100. .P
  101. The age of the cache, in seconds, before another registry request is made\.
  102. .SS registry
  103. .RS 0
  104. .IP \(bu 2
  105. Default: https://registry\.npmjs\.org/
  106. .IP \(bu 2
  107. Type: url
  108. .RE
  109. .P
  110. Search the specified registry for modules\. If you have configured npm to point
  111. to a different default registry, such as your internal private module
  112. repository, \fBnpm search\fP will default to that registry when searching\. Pass a
  113. different registry url such as the default above in order to override this
  114. setting\.
  115. .SS See Also
  116. .RS 0
  117. .IP \(bu 2
  118. npm help registry
  119. .IP \(bu 2
  120. npm help config
  121. .IP \(bu 2
  122. npm help npmrc
  123. .IP \(bu 2
  124. npm help view
  125. .RE