Overview
Thepm ls command lists installed dependencies in your project. It’s a passthrough to your package manager’s native ls command, with automatic handling of package manager differences.
Syntax
Arguments
Additional arguments to pass to the underlying package manager’s ls command
Examples
List All Dependencies
Output (pnpm)
List Specific Package
Output
List with Depth
Output
List Dev Dependencies
Output
List Production Dependencies
Output
Package Manager Differences
Better PM handles differences between package managers automatically:src/commands/ls.ts:14-17:
Bun requires
bun pm ls instead of just bun ls, which Better PM handles automatically.Common Use Cases
Check Dependency Version
Verify Installation
List Top-Level Dependencies
Find Dependency Issues
List Global Packages
Output Format
The output shows:- Package name and version at the root level
- Dependency tree with proper nesting
- Versions for each installed package
- Missing or invalid dependencies (marked with WARN or ERR)
Supported Arguments
Common arguments that work across package managers:| Argument | Description |
|---|---|
--depth=<n> | Limit dependency tree depth |
--dev | List only dev dependencies |
--prod | List only production dependencies |
--global | List globally installed packages |
--json | Output as JSON |
--long | Show extended information |
--parseable | Output parseable format |
Related Commands
- pm pls - List workspace packages (monorepo)
- pm why - Explain why a package is installed
- pm install - Install dependencies