0.0.5 • Published 3 months ago

@sonulodha/organize-imports v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Organize Imports

Organize Imports is a convenient and robust CLI utility to automatically organize your project files into appropriate directories based on their import statements. It maintains a clean and structured project, significantly reducing manual file management.

⚡️ Common Use Case

Perfect for fixing directory issues caused by tools like v0, which often place components and related files into a flat directory structure. This utility effortlessly reorganizes files into their intended structured directories.

🔑 Key Features

  • Automatic File Organization: Moves files into directories automatically based on their imports.
  • Supports Multiple Source Directories: Works seamlessly with directories like components, lib, hooks, utils, and types.
  • Flexible Import Alias Handling: Customizable import alias (e.g., @/components).
  • Command-line Only: Simple CLI commands without the need for additional imports or setup.

📦 Installation

Install with npm:

npm install @sonulodha/organize-imports

🚀 Usage

CLI Usage

Use it directly from your command line (recommended):

npx @sonulodha/organize-imports ./app

If installed globally:

npm install -g @sonulodha/organize-imports
organize-imports ./app

⚙️ Configuration (Optional)

The CLI organizes files based on these sensible defaults:

  • dir: Directory to organize (default: "./app").
  • sourceFolders: Directories considered sources (["components", "lib", "hooks", "utils", "types"]).
  • importAlias: Import alias ("@/").

For custom usage, consider modifying source code directly or contribute enhancements.

📌 Additional Use Cases

  • React/Next.js Projects: Keep component directories structured.
  • Large Codebases: Automatically reorganize files logically.
  • Maintainability: Maintain consistent, navigable structures.

🤝 Contributing

We welcome contributions, bug reports, and feature requests!

🐛 Reporting Issues

Encountered a problem? Please open an issue.

🌟 Star the Project

If this tool helped you, please star the repository: ⭐ Star on GitHub

📄 License

Licensed under the MIT License. See the LICENSE file for details.

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago