If you're migrating a project from JavaScript to TypeScript, it's typically a good idea to work your way up from the leaves (modules with no dependencies). One way of codifying an order would be topological sort: print a list of modules where no module appears until all its dependencies have already appeared. This would give you the order in which to perform the migration.
This could probably be done as a post-processing step with madge --json, but it would be more convenient as part of the library.
If you're migrating a project from JavaScript to TypeScript, it's typically a good idea to work your way up from the leaves (modules with no dependencies). One way of codifying an order would be topological sort: print a list of modules where no module appears until all its dependencies have already appeared. This would give you the order in which to perform the migration.
This could probably be done as a post-processing step with
madge --json
, but it would be more convenient as part of the library.