lerna list / lerna ls

lerna list 默认仅列出所有 Public Package(即缺省了 --no-private),如果需要列出所有 Package,需要添加 --all 选项。

用法

  1. $ lerna list
  2. List local packages
  3. Command Options:
  4. --json Show information as a JSON array [boolean]
  5. --ndjson Show information as newline-delimited JSON [boolean]
  6. -a, --all Show private packages that are normally hidden [boolean]
  7. -l, --long Show extended information [boolean]
  8. -p, --parseable Show parseable output instead of columnified view [boolean]
  9. --toposort Sort packages in topological order instead of lexical by directory [boolean]
  10. --graph Show dependency graph as a JSON-formatted adjacency list [boolean]
  11. Filter Options:
  12. --scope Include only packages with names matching the given glob. [string]
  13. --ignore Exclude packages with names matching the given glob. [string]
  14. --no-private Exclude packages with { "private": true } in their package.json. [boolean]
  15. --since Only include packages that have been changed since the specified [ref].
  16. If no ref is passed, it defaults to the most-recent tag. [string]
  17. --exclude-dependents Exclude all transitive dependents when running a command
  18. with --since, overriding the default "changed" algorithm. [boolean]
  19. --include-dependents Include all transitive dependents when running a command
  20. regardless of --scope, --ignore, or --since. [boolean]
  21. --include-dependencies Include all transitive dependencies when running a command
  22. regardless of --scope, --ignore, or --since. [boolean]
  23. --include-merged-tags Include tags from merged branches when running a command with --since. [boolean]
  24. Global Options:
  25. --loglevel What level of logs to report. [string] [default: info]
  26. --concurrency How many processes to use when lerna parallelizes tasks. [number] [default: 4]
  27. --reject-cycles Fail if a cycle is detected among dependencies. [boolean]
  28. --no-progress Disable progress bars. (Always off in CI) [boolean]
  29. --no-sort Do not sort packages topologically (dependencies before dependents). [boolean]
  30. --max-buffer Set max-buffer (in bytes) for subcommand execution [number]
  31. -h, --help Show help [boolean]
  32. -v, --version Show version number

选项

选项 描述
--all 列出所有 Package,包括 Private Package
--no-private 排除 Private Package,即排除 package.json 中包含 {"private": true} 的 Package 。该选项为默认缺省的选项。

简写

命令 描述
lerna ls lerna list
lerna la lerna list -la / lerna list --list --all,即列出 Package 的名称、版本,以及 PRIVATE

示例