Last updated:
0 purchases
import converter
Import Converter #
A Dart command-line tool for converting package imports to path imports and vice versa in a Dart project.
Features #
Automatically scans all .dart files within the project and converts package imports to path imports.
Supports reverting path imports back to package imports.
Excludes processing files in the test folder.
Retrieves the project name from the pubspec.yaml file.
Installation #
Activate the import_converter package globally:
dart pub global activate import_converter
copied to clipboard
Running #
Convert package imports to path imports:
import_converter --path /path/to/your/dart/project
copied to clipboard
Convert path imports back to package imports:
import_converter --path /path/to/your/dart/project --revert
copied to clipboard
Command Line Options #
--path or -p: The path to the directory containing your Dart project.
--revert or -r: Revert path imports back to package imports. By default, the program converts package imports to path imports.
Limitations #
This tool assumes a standard Dart project structure with a lib folder containing the source code and a pubspec.yaml file.
It does not currently support custom import prefixes or aliasing.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.