This gist leverages Node's experimental loader hooks to create a dependency tree of your app. This can be useful to find circular dependencies, or diagnose race conditions / import order issues. Note: Experimental Loader Hooks are, well, experimental! This has been validated to run against Node v16.13.0
Here's the output of running NODE_NO_WARNINGS=1 node --experimental-loader=./loader-tracer.js index.js
with this gist:
index.js
(node{,_modules} excluded)