yarn list
列出已安装的软件包。
yarn list
yarn list
yarn list 命令模仿预期的 Unix 列表行为。在 Yarn 中,list 命令通过引用所有包管理器元数据文件(其中包括项目的依赖)列出当前工作目录的所有依赖。
¥The yarn list command mimics the expected Unix behavior of listing. In Yarn, the list
command lists all dependencies for the current working directory by referencing all
package manager meta data files, which includes a project’s dependencies.
yarn list vx.x.x
├─ package-1@1.3.3
├─ package-2@5.0.9
│ └─ package-3@^2.1.0
└─ package-3@2.7.0
yarn list [--depth] [--pattern]
默认情况下,将显示所有包及其依赖。要限制依赖的深度,你可以将标志 --depth 以及所需的级别添加到 list 命令。
¥By default, all packages and their dependencies will be displayed. To restrict the depth of the
dependencies, you can add a flag, --depth, along with the desired level to the list command.
yarn list --depth=0
请记住,级别是零索引的。
¥Keep in mind, levels are zero-indexed.
yarn list --pattern <pattern> 将通过模式标志过滤依赖列表。
¥yarn list --pattern <pattern> will filter the list of dependencies by the pattern flag.
示例:
¥Examples:
yarn list --pattern gulp
yarn list --pattern "gulp|grunt"
yarn list --pattern "gulp|grunt" --depth=1