akhil-express-docs
v1.0.4
Published
Zero-config runtime API documentation middleware for Express
Downloads
58
Maintainers
Readme
Express-O Docs
Zero-config runtime API documentation for Express.js.
Stop spending hours writing Swagger comments or manual OpenAPI files. Express-O observes your API traffic in real-time and automatically generates a beautiful, interactive documentation dashboard using Scalar.
✨ Features
- Runtime Inference – Automatically generates JSON Schemas from real request/response bodies
- Zero Manual Entry – No need for JSDoc comments or manual Swagger YAML files
- Security First – Automatically masks sensitive data like passwords, tokens, and secrets
- Query & Path Support – Captures query parameters (e.g.,
?page=1) and dynamic routes - Standardized – Generates valid OpenAPI 3.0 specifications
- Dev-Safe – Runs only in development mode
📦 Installation
npm install akhil-express-docs🚀 Quick Start
Add the middleware to your Express app. Make sure to place it above your routes.
const express = require('express');
const autoDocs = require('akhil-express-docs');
const app = express();
app.use(express.json());
app.use(autoDocs);
app.get('/api/users', (req, res) => {
res.json({ success: true, users: [] });
});
app.listen(5000, () => {
console.log('Server running on http://localhost:5000');
console.log('View Docs at http://localhost:5000/docs');
});🛠️ How to View Your Docs
- Run your server
- Hit your API endpoints (Postman, browser, or frontend)
- Open: http://localhost:5000/docs
- Raw JSON: http://localhost:5000/docs/json
🔒 Security & Privacy
This middleware includes a masking engine.
Sensitive fields like:
- token
- password
- secret
- authorization
are automatically replaced with ****.
📄 License
MIT © Akhil Raj
