Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to count the number of installed packages, including dependencies

Is there an easy way to obtain a count of installed npm packages, both global and local to an application?

For example, after running create-react-app [1], I get screens-full of packages and dependencies installed when I enter the npm ls command.

How to find a count ("cardinality") of said packages and dependencies eludes me. Tyvm, Keith :^)

References:

  1. https://github.com/facebook/create-react-app
like image 769
kmiklas Avatar asked Feb 01 '18 17:02

kmiklas


1 Answers

Try:

npm ls --parseable | wc -l
like image 129
mkleehammer Avatar answered Oct 16 '22 12:10

mkleehammer