npm-search
搜索匹配条件的包
概要
npm search <term> [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
aliases: s, se, find
描述
此命令在 registry 中搜索与条件 (term) 匹配的信息,然后展示符合条件的所有的包。条件不一定是包名,只要是包中任何信息匹配了,都会被搜索出来。
> npm search "jquery library"
如上只要任意包中含有信息"jquery library",都会被搜出来。
配置
description
- Default: true
- Type: Boolean
若值为false用法和--no-description一样,禁用包描述中的搜索匹配,并禁止在结果中显示该字段。
> npm search "jquery library" --no-description
# 同上
> npm search "jquery library" --description=false
json
- Default: false
- Type: Boolean
将结果以JSON格式展示。
parseable
- Default: false
- Type: Boolean
以简单的分隔方式展示结果。
long
- Default: false
- Type: Boolean
以多行展示完整的包装描述和其他长文本。
registry
- Default: "https://registry.npmjs.org/"
- Type: Url
默认从如上 registry 地址搜索,当然也可以重设新的 registry 地址。
> npm search "jquery library" --registry="https://xxxxx"