How to find custom modules in node.js dependency tree?

I have a node.js application with about 10 direct dependencies that result in 50 dependencies.

Now I would like to know if any of these dependencies uses native code (except, of course, the node.js platform itself), for example, external system libraries (I saw libxml used in other projects), native C / C + libraries +, node -gyp script scripts that need compilers, etc. etc.

Is there an easy / quick way to check the entire dependency tree of a given module for such cases?

+4
source share
1 answer

You can simply search for files *.node, which is an extension used compiled addons: find node_modules -type f -name "*.node" 2>/dev/null | grep -v "obj\.target".

If you want to check which shared libraries each addon uses, you can use something like: find node_modules -type f -name "*.node" 2>/dev/null | grep -v "obj\.target" | xargs ldd

+6
source

All Articles