yarn global add sort-dependency
git clone https://github.com/babel/babel.git --depth 1
cd babel
sort-dependency --root . --cache-dir .cache
Result
Info: independents libraries (Suggest: '--start')- @babel/plugin-codemod-object-assign-to-object-spread
- @babel/plugin-codemod-optional-catch-binding
- @babel/eslint-config-internal
- @babel/eslint-plugin-development
- @babel/eslint-plugin
- @babel/eslint-shared-fixtures
- @babel/eslint-tests
- babel
- @babel/cli
- @babel/helper-explode-class
- @babel/helper-plugin-test-runner
- @babel/node
- @babel/plugin-external-helpers
- @babel/plugin-proposal-export-default-from
- @babel/plugin-proposal-export-namespace-from
- @babel/plugin-proposal-function-bind
- @babel/plugin-proposal-function-sent
- @babel/plugin-proposal-logical-assignment-operators
- @babel/plugin-proposal-numeric-separator
- @babel/plugin-proposal-partial-application
- @babel/plugin-proposal-throw-expressions
- @babel/plugin-syntax-class-properties
- @babel/plugin-transform-flow-comments
- @babel/plugin-transform-instanceof
- @babel/plugin-transform-jscript
- @babel/plugin-transform-object-assign
- @babel/plugin-transform-object-set-prototype-of-to-assign
- @babel/plugin-transform-property-mutators
- @babel/plugin-transform-proto-to-assign
- @babel/plugin-transform-react-constant-elements
- @babel/plugin-transform-react-inline-elements
- @babel/plugin-transform-react-jsx-compat
- @babel/plugin-transform-runtime
- @babel/plugin-transform-strict-mode
- @babel/preset-typescript
- @babel/runtime-corejs2
- @babel/runtime-corejs3
- @babel/runtime
- @babel/standalone
Info: last independents libraries (Suggest: '--stop')
- @babel/helper-plugin-utils
- @babel/parser
Info: Standalone library
- @babel/eslint-plugin-development
- @babel/eslint-tests
- babel
- @babel/standalone
Using topological sort: (https://en.wikipedia.org/wiki/Topological_sorting)
sort-dependency \
--root . \
--cache-dir .cache \
--start "@babel/plugin-codemod-object-assign-to-object-spread" \
--stop "@babel/parser"
Result
Topological sorting result: @babel/plugin-codemod-object-assign-to-object-spread -> @babel/parser- @babel/plugin-codemod-object-assign-to-object-spread
- @babel/core
- @babel/helpers
- @babel/traverse
- @babel/helper-function-name
- @babel/template
- @babel/parser
sort-dependency \
--root .\
--cache-dir .cache\
--output library-map.png
sort-dependency \
--root . \
--cache-dir .cache \
--start "@babel/plugin-codemod-object-assign-to-object-spread" \
--stop "@babel/parser" \
--output sorted-graph.png
sort-dependency is MIT licensed.