How to list npm user-installed packages?

lolski picture lolski · Jul 30, 2013 · Viewed 361.1k times · Source

How do I list the user-installed package ONLY in npm? When I do npm -g list it outputs every package and their dependencies, which is not what I want.

Answer

aris picture aris · Aug 26, 2014

This works pretty well too: npm list -g --depth=0

  • npm: the Node package manager command line tool
  • list -g: display a tree of every package found in the user’s folders (without the -g option it only shows the current directory’s packages)
  • depth 0 / — depth=0: avoid including every package’s dependencies in the tree view