npm-ls: add global scope example and long alias (#17959)

This commit is contained in:
Managor
2025-09-03 22:07:49 +03:00
committed by GitHub
parent 4f2317f3ea
commit 08862f89e9
+10 -6
View File
@@ -3,22 +3,26 @@
> Print installed packages to `stdout`.
> More information: <https://docs.npmjs.com/cli/npm-ls>.
- Print all versions of direct dependencies to `stdout`:
- Print all versions of direct dependencies in the current project to `stdout`:
`npm ls`
`npm {{[ls|list]}}`
- Print all installed packages including peer dependencies:
`npm ls {{[-a|--all]}}`
`npm {{[ls|list]}} {{[-a|--all]}}`
- Print all globally installed packages:
`npm {{[ls|list]}} {{[-g|--global]}}`
- Print dependencies with extended information:
`npm ls {{[-l|--long]}}`
`npm {{[ls|list]}} {{[-l|--long]}}`
- Print dependencies in parseable format:
`npm ls {{[-p|--parseable]}}`
`npm {{[ls|list]}} {{[-p|--parseable]}}`
- Print dependencies in JSON format:
`npm ls --json`
`npm {{[ls|list]}} --json`