返回介绍

npm-search

发布于 2019-05-30 13:06:35 字数 3063 浏览 1196 评论 0 收藏 0

Search for packages

概要

npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]

aliases: s, se, find

详情

Search the registry for packages matching the search terms. npm search performs a linear, incremental, lexically-ordered search through package metadata for all files in the registry. If color is enabled, it will further highlight the matches in the results.

Additionally, using the --searchopts and --searchexclude options paired with more search terms will respectively include and exclude further patterns. The main difference between --searchopts and the standard search terms is that the former does not highlight results in the output and can be used for more fine-grained filtering. Additionally, both of these can be added to .npmrc for default search filtering behavior.

Search also allows targeting of maintainers in search results, by prefixing their npm username with =.

If a term starts with /, then it's interpreted as a regular expression and supports standard JavaScript RegExp syntax. A trailing / will be ignored in this case. (Note that many regular expression characters must be escaped or quoted in most shells.)

A Note on caching

Configuration

详情

  • Default: true
  • Type: Boolean

Used as --no-description, disables search matching in package descriptions and suppresses display of that field in results.

json

  • Default: false
  • Type: Boolean

Output search results as a JSON array.

parseable

  • Default: false
  • Type: Boolean

Output search results as lines with tab-separated columns.

long

  • Default: false
  • Type: Boolean

Display full package descriptions and other long text across multiple lines. When disabled (default) search results are truncated to fit neatly on a single line. Modules with extremely long names will fall on multiple lines.

searchopts

  • Default: ""
  • Type: String

Space-separated options that are always passed to search.

searchexclude

  • Default: ""
  • Type: String

Space-separated options that limit the results from search.

searchstaleness

  • Default: 900 (15 minutes)
  • Type: Number

The age of the cache, in seconds, before another registry request is made.

registry

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文