Josherich's Blog

HOME SHORTS PODCAST SOFTWARES DRAWING ABOUT RSS

Dominator Tree For NPM Dependencies

Find the dominator tree of your npm dependencies.

  1. run npm list --json in your project folder. (consider adding --depth=n and --omit=dev)

  2. paste the output below.

The dominator tree is useful because of this nice property: if you remove a node in the dominator tree, the entire subtree beneath it is no longer reachable from the root. It means if a node has a big number of descendants, it’s a good candidate for cutting down the dependency tree.

Here’s the example output for @babel/[email protected]

_