Let's say we have a package on NPM like got.
I want to figure out which core NodeJS modules this package is using as I want to polyfill it on environments (like React native, or the browser).
Is there any way where I can just get a list of which core NodeJS modules this package is using without manually searching through the source code?
I know there are ways to figure out the dependency tree -- that is not what I am asking. I specificially want to know which core NodeJS modules are being used.
There is no way to do this that is not manual unfortunately.
However, it is pretty simple to do.
Simply search all the files in your project via your IDE. CMD+F
for things like crypto
, buffer
, stream
, etc.
https://flaviocopes.com/node-core-modules/ is a list of all the core node modules