@arikajs/docs
v0.0.4
Published
API documentation and Postman collection generator for ArikaJS.
Downloads
567
Maintainers
Readme
Arika Docs
@arikajs/docs is the documentation engine of the ArikaJS ecosystem.
It allows you to automatically generate high-quality API documentation, Postman collections, and OpenAPI specifications by analyzing your application's routes.
The goal of this package is to eliminate the manual work of keeping documentation in sync with your codebase.
Status
- Stage: Experimental / v0.x
- Scope (v0.x):
- Route metadata extraction from
@arikajs/router - Postman Collection (v2.1.0) generation
- Arika-themed interactive HTML documentation
- Markdown (DOCS.md) generation
- OpenAPI 3.0 specification generation
- Route metadata extraction from
Features
Multi-Format Generation
- HTML: A premium, interactive web page for your API.
- Postman: Ready-to-import JSON collection with pre-configured headers.
- OpenAPI: Industry-standard Swagger/OpenAPI 3.0 specification.
- Markdown: Clean, readable
DOCS.mdfor GitHub or local documentation.
Route Analysis
- Automatically groups endpoints by prefix (e.g.,
api,admin). - Captures route names, methods, and full path hierarchies.
- Displays middleware information for each endpoint.
- Automatically groups endpoints by prefix (e.g.,
Environment Support
- Automatically generates Postman environment JSON with your
base_url.
- Automatically generates Postman environment JSON with your
Installation
npm install @arikajs/docsThis package is designed to be used with the ArikaJS CLI but can also be used as a standalone library.
Usage (via CLI)
The easiest way to generate documentation is using the ArikaJS CLI:
arika docs:generateThis will create a docs/ directory in your project root containing all generation artifacts.
Standalone Usage
import { DocumentationGenerator } from '@arikajs/docs';
const generator = new DocumentationGenerator();
generator.generateAll('My App Name', './docs-output');Project Structure
Inside the docs package:
src/PostmanGenerator.ts– Handles Postman JSON generationHtmlGenerator.ts– Handles premium HTML documentationMarkdownGenerator.ts– Handles Markdown generationOpenApiGenerator.ts– Handles OpenAPI 3.0 generationGenerator.ts– The main orchestratorindex.ts– Public exports
Philosophy
“Your code is the source of truth; your documentation should reflect it instantly.”
Contributing
Contributions are welcome, especially around:
- Adding support for JSDoc-based parameter descriptions.
- Enhancing the HTML documentation search and "Try it out" features.
- Adding support for more documentation formats.
License
@arikajs/docs is open-sourced software licensed under the MIT license.
