概要

npm help-search <text>

描述

此命令根据< text >搜索所有npm markdown的帮助文档,然后列出有< text >文字的所有文档,按相关性排序。

如果只搜出一个文件符合,等同于直接使用help命令,会以浏览器方式打开帮助文档。

如果npm help没有查到主题,那么它会调用help-search来搜索,所以很少直接调用此命令。

配置

long
  • 类型:boolean
  • 默认:false

如果为true,则会查找出含有该text字符文件,以及展示其所在文件中的段落。

如果为false,将只列出找到的帮助主题。

示例

查找含有display字符的所有文件,long=false
> npm help-search display

Top hits for "display"
————————————————————————————————————————————————————————————————————————————————
npm help index                                                         display:4
npm help ls                                                            display:4
npm help search                                                        display:2
npm help profile                                                       display:1
npm help doctor                                                        display:1
npm help package.json                                                  display:1
npm help config                                                        display:1
npm help whoami                                                        display:1
npm help bin                                                           display:1
npm help prefix                                                        display:1
npm help root                                                          display:1
————————————————————————————————————————————————————————————————————————————————
(run with -l or --long to see more context)
查找含有display字符的所有文件,long=true
> npm help-search display --long=true

# 仅展示部分

npm help index                                                         display:4
————————————————————————————————————————————————————————————————————————————————
### npm-bin(1)
Display npm bin folder
### npm-bugs(1)

npm help ls                                                            display:4
————————————————————————————————————————————————————————————————————————————————
* Type: Int
Max display depth of the dependency tree.
### prod / production

.
.
.

当然 --long=true 也可以直接简写成 -l 即可。

results matching ""

    No results matching ""