sort-dependency
v0.3.0
Published
sorting library dependencies
Downloads
4
Maintainers
Readme
sort-dependency
Install
yarn global add sort-dependency
Usage Example
git clone https://github.com/babel/babel.git --depth 1
cd babel
Search top or deep or standalone libraries
sort-dependency --root . --cache-dir .cache
- @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
Find dependency order
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"
- @babel/plugin-codemod-object-assign-to-object-spread
- @babel/core
- @babel/helpers
- @babel/traverse
- @babel/helper-function-name
- @babel/template
- @babel/parser
Output dependency graph example
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
License
sort-dependency is MIT licensed.