documentcodegenerator
v1.0.1
Published
Automatically generate documentation for code files in simple language
Maintainers
Readme
documentcodegenerator
Automatically generate documentation for code files in simple language.
Installation
npm install documentcodegeneratorCLI Usage
docgen <file-path> [options]Options
--format, -f- Output format: markdown (default), json, text--output, -o- Output file path (optional, prints to console if not specified)--verbose, -v- Show detailed information--help, -h- Show help message
Examples
# Generate documentation for a file
docgen index.html
# Generate JSON output
docgen app.js --format json
# Save documentation to file
docgen styles.css --output docs.mdProgrammatic Usage
const { DocumentCodeGenerator } = require('documentcodegenerator');
async function main() {
const generator = new DocumentCodeGenerator({
outputFormat: 'markdown',
verbose: true
});
const documentation = await generator.generate('index.js');
console.log(documentation);
}
main();Supported Languages
- JavaScript/Node.js
- TypeScript
- HTML
- CSS/SCSS
- Python
- Java
- JSON
- Markdown
- Generic (for other languages)
Features
- Automatic language detection
- Code structure analysis
- Import/export analysis
- Function documentation
- Console output explanation
- Error handling detection
- Responsive design analysis (HTML)
- CSS variable documentation
- Multiple output formats (markdown, JSON, text)
