npm ls --depth=0

Category: Node.js & npm/yarn

npm ls --depth=0

List only top-level installed packages

Shows only the directly installed packages (depth 0), hiding nested dependencies.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.