Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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