npm-completion
npm 的选项卡补全
选择命令行版本:
See Details
目录
概要
¥Synopsis
npm completion
注意:此命令对工作区无感知。
¥Note: This command is unaware of workspaces.
描述
¥Description
在所有 npm 命令中启用制表符补全。
¥Enables tab-completion in all npm commands.
上面的概要将完成加载到你当前的 shell 中。将其添加到你的 ~/.bashrc 或 ~/.zshrc 将使完成在任何地方都可用:
¥The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available everywhere:
npm completion >> ~/.bashrcnpm completion >> ~/.zshrc
当然,如果你有一个可以为你读取该文件的系统,你当然也可以将 npm completion 的输出通过管道传输到诸如 /usr/local/etc/bash_completion.d/npm 或 /etc/bash_completion.d/npm 之类的文件中。