Convert the output of npm ls --json to a dependency graph. For more info, visit the GitHub repo: https://github.com/pmuellr/npmls2dg
Drop a .json file on this page to have it's dependency graph rendered, like the sample below. Here's a sample you can download: npmls2dg.json
Generate the .json file by redirecting the output of npm ls into a .json file, in one of your projects' root directories. Here's an example using the --production flag, which only processes your dependencies and not your devDependencies.
npm ls --json --production > deps.json