yarn list
列出所有已安裝的套件。
yarn list
yarn list
指令 yarn list
與 Unix 下的列出檔案的行為相仿。 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
所列出的相依性層級。
yarn list --depth=0
請記得,層級是從 0 起算的。
yarn list --pattern <pattern>
會篩選出在pattern標記中的相依套件。
例如:
yarn list --pattern gulp
yarn list --pattern "gulp|grunt"
yarn list --pattern "gulp|grunt" --depth=1