Promizer is a command-line tool designed to analyze promiser tags in JavaScript (or Node.js) files and generate API documentation in Markdown format. It helps developers automate the process of creating documentation for endpoints defined with special tags in the code.
- Analyze Promiser Tags: Scans JavaScript files for
promisertags and extracts relevant information about API endpoints. - Generate Markdown Documentation: Converts extracted data into a structured Markdown format for API documentation.
- Command-Line Interface (CLI): Simple and intuitive CLI to run the tool and generate documentation.
Ensure you have Rust installed on your machine.
- Install Rust from the official website if you haven't already.
- Clone this repository:
git clone https://github.com/hacimertgokhan/promizer.git- Navigate to the project directory:
cd promizer- Build the project using Cargo:
cargo build --releaseTo use Promizer, run it from the command line with the -i or --input flag to specify the JavaScript file to analyze. The tool will output the generated API documentation in a Markdown file.
cargo run -- -i server.jsThis will process the server.js file and create a api_documentation.md file in the current directory.
-i, --input FILE: Specifies the input file (JavaScript file) to analyze forpromisertags.
-
Find Promiser Tags: The tool searches for
//promizer()tags in the provided file. Each tag contains metadata about an API endpoint such as HTTP method, format, and request body. -
Parse the Tags: Each tag is parsed to extract useful information like:
- HTTP method (e.g., GET, POST)
- Format (e.g., JSON, XML)
- Request body parameters
-
Generate Documentation: The extracted data is formatted into a readable Markdown format and written to a
.mdfile.
//promizer(type='GET', format='json', body=['user_id'])
//promizer(type='POST', format='json', body=['name', 'email'])# Endpoint Documentation
**Type**: GET
**Format**: json
**Request Body**:
- user_id
---
# Endpoint Documentation
**Type**: POST
**Format**: json
**Request Body**:
- name
- emailWe welcome contributions to improve the project! Here are a few ways you can contribute:
- Bug Reports: If you find any bugs, please open an issue in the GitHub repository.
- Feature Requests: If you have any ideas for new features or improvements, feel free to create an issue or submit a pull request.
- Documentation: Help improve this documentation by submitting a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
For more information, you can contact the project maintainer at:
Email: hacimertgokhan@gmail.com
GitHub: hacimertgokhan