callum callum - 16 days ago 5
Node.js Question

Easy way to list node modules I have npm linked?

I am looking for a command that will list the names of global modules that I have

npm link
'd to local copies, also listing the local path.

In fact, a list of all globally installed modules would be even better, with the
npm link
'd ones flagged somehow.

Answer

Did you try just listing the node_modules directory contents (e.g. ls -l node_modules | grep ^l)? They're normal symlinks.

If you really need to find all symlinks, you could try something like find / -type d -name "node_modules" 2>/dev/null | xargs -I{} find {} -type l -maxdepth 1 | xargs ls -l.