easydox
v1.0.11
Published
Easydox - Automate your JavaScript/TypeScript project documentation with ease.
Downloads
57
Maintainers
Readme
Easydox
✨ Easydox - Automate your JavaScript/TypeScript project documentation effortlessly using your code comments, JSDoc, and the power of Abstract Syntax Trees (AST).
🚀 What is Easydox?
Easydox is a powerful and developer-friendly CLI tool that automates the process of generating beautiful and informative documentation for your JavaScript and TypeScript projects. It intelligently parses your source code, extracts JSDoc comments, and analyzes your code structure to create comprehensive documentation in multiple formats.
The core philosophy of Easydox is to make documentation a seamless part of your development workflow. Write meaningful comments as you code, and let Easydox handle the rest.
✨ Key Features
- Auto-Generated Documentation: Effortlessly create Markdown, MDX, and JSON documentation from your codebase.
- AST-Powered Analysis: Utilizes Abstract Syntax Trees (AST) via the Babel parser for a deep and accurate understanding of your code.
- JSDoc Support: Automatically extracts and incorporates your existing JSDoc comments.
- Multiple Output Formats: Generate documentation in
md,mdx, andjsonformats to suit your needs. - Flexible CLI: Choose between an interactive mode that guides you through the process or a non-interactive mode for automation and CI/CD pipelines.
- AI-Powered Enhancements: Leverages Ollama and the Mistral model to generate intelligent summaries for your project and components.
- Easy Integration: Seamlessly integrates into any JavaScript or TypeScript project.
- Fast and Efficient: Designed to be fast and developer-friendly.
🔧 How It Works
Easydox works by performing the following steps:
- Directory Parsing: It recursively scans your source directory to find all relevant
.js,.ts,.jsx, and.tsxfiles. - AST Parsing: Each file is parsed into an Abstract Syntax Tree (AST). This allows Easydox to understand the structure of your code, including variables, functions, classes, and more.
- JSDoc Extraction: It extracts JSDoc comments associated with your code elements.
- Documentation Generation: Based on the parsed information, it generates documentation in the formats you specify.
- AI Summarization (Optional): If enabled, it uses Ollama to generate a summary of your project and individual components.
🧠 AI-Powered Documentation
Easydox can use Ollama with the mistral:7b model to provide AI-powered enhancements to your documentation. This feature removes the dependency on paid services like OpenAI or OpenRouter.
Requirements:
Before running Easydox with AI features, you need to have Ollama installed and the mistral:7b model pulled.
# 1. Install Ollama
https://ollama.com/download
# 2. Pull the mistral:7b model
ollama pull mistral:7b📦 Installation
You can install Easydox globally to use it as a command-line tool in any project:
npm install -g easydoxAlternatively, you can install it as a development dependency in your project:
npm install --save-dev easydox🛠️ Usage
Interactive Mode (Recommended)
For the best experience, especially when using Easydox for the first time, run it without any arguments:
easydoxEasydox will ask you a series of questions to configure the documentation generation process, including the source directory, output directory, desired formats, and whether to enable AI-powered summaries.
Command-Line Mode
You can also use command-line arguments for non-interactive use, which is ideal for scripts and CI/CD environments.
easydox -s <source_directory> -o <output_directory> -f <formats>Options:
| Option | Description | Default |
| --------------- | ----------------------------------------------------------------- | ------------- |
| -s, --source | The source directory containing your JavaScript/TypeScript files. | ./src |
| -o, --output | The directory where the generated documentation will be saved. | ./docs |
| -f, --formats | A comma-separated list of output formats (md, json, mdx). | md,json,mdx |
Examples:
# Generate documentation for the 'src' directory in all formats
easydox -s ./src -o ./docs -f md,json,mdx
# Generate only Markdown documentation
easydox -s ./src -o ./docs -f md
# Generate documentation for a different source directory
easydox -s ./lib -o ./documentation📄 Example Output
After running Easydox, your output directory will be populated with the generated documentation files. For example, if you have a file named button.js, the output might look like this:
/docs
├── button.md
├── button.mdx
└── button.json🤝 Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please feel free to open an issue or submit a pull request.
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Vikram Samak
