Skip to content

Instantly share code, notes, and snippets.

@TotallyInformation
Created September 7, 2019 16:54
Show Gist options
  • Save TotallyInformation/db883775a0c3b47d2b519a5db4e986ca to your computer and use it in GitHub Desktop.
Save TotallyInformation/db883775a0c3b47d2b519a5db4e986ca to your computer and use it in GitHub Desktop.
How many node.js packages are installed

Not really a flow, sorry about that, because you need to change directory to the userDir which may be different on different installations.

However, when you are in the right folder, you can issue the following command to find out how many node.js packages you have installed. Including all of the sub-dependencies for every package (e.g. everything!).

npm ls | sed '/deduped$/d' | wc -l

You do need sed and wc though so this will only really work from Linux command lines (including the Windows WSL) - maybe Mac too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment