npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

apidocs-sparkcrm

v3.0.0

Published

Automated API documentation generator that creates markdown docs, PDF, and Postman collections from Express.js routes

Downloads

173

Readme

API Docs Generator 🚀

Automated API documentation generator that creates comprehensive documentation from your Express.js routes, including:

  • 📄 Markdown Documentation - Detailed API docs with request/response examples
  • 📋 PDF Documentation - Professional PDF format for sharing
  • 📦 Postman Collection - Ready-to-import collection for API testing

Features ✨

  • Automatic Route Detection - Scans your Express.js routes automatically
  • Request Body Extraction - Extracts request schemas from controller functions
  • Response Schema Analysis - Analyzes response patterns from your code
  • Multiple Output Formats - Markdown, PDF, and Postman collection
  • Smart Pattern Recognition - Supports various Express.js patterns
  • Professional Documentation - Clean, organized, and easy to read

Installation 📦

npm install -g apidocs

Or use directly with npx:

npx apidocs

Usage 🎯

Simply run the command in your Express.js project directory:

npx apidocs

The tool will automatically:

  1. Scan your src/, api/, controllers/, and routes/ directories
  2. Extract all Express.js routes
  3. Analyze controller functions for request/response schemas
  4. Generate comprehensive documentation

Output Files 📁

After running, you'll get these files in the docs/ folder:

  • api-docs.md - Detailed markdown documentation
  • api-docs.pdf - Professional PDF documentation
  • postman-collection.json - Postman collection for API testing

Supported Express Patterns 🔧

The tool recognizes these Express.js patterns:

// Standard router patterns
router.get('/users', userController.getUsers);
router.post('/users', userController.createUser);

// With middleware
router.get('/users', authMiddleware, userController.getUsers);

// App patterns
app.get('/api/users', userController.getUsers);

// Express.Router patterns
.get('/users', userController.getUsers)

Request Body Detection 🎯

The tool automatically detects request body schemas from:

// Destructuring patterns
const { name, email, age } = req.body;

// Direct usage
req.body.name
req.body.email

Response Analysis 📊

Response schemas are extracted from:

// Success responses
res.json(result.rows);
res.json(result.rows[0]);

// Error responses
res.status(400).json({ message: err.message });

Example Output 📋

Markdown Documentation

# My API Project - API Documentation

## 📊 API Statistics
| Method | Count |
|--------|-------|
| GET    | 2     |
| POST   | 1     |
| PUT    | 1     |
| DELETE | 1     |

## 🚀 API Endpoints

### 1. getUsers
**Method:** `GET`
**URL:** `/users`
**Request Body:**
```json
{}

Response:

[{"id": 1, "name": "John", "email": "[email protected]"}]

### Postman Collection
The generated Postman collection includes:
- All API endpoints with proper HTTP methods
- Request body examples for POST/PUT/PATCH requests
- Response examples
- Environment variables (baseUrl)
- Proper headers and content types

## Configuration ⚙️

The tool automatically scans these directories:
- `src/`
- `api/`
- `controllers/`
- `routes/`

## Requirements 📋

- Node.js 12.0.0 or higher
- Express.js project structure
- Standard Express.js route patterns

## Contributing 🤝

Contributions are welcome! Please feel free to submit a Pull Request.

## License 📄

MIT License - feel free to use in your projects!

## Support 💬

If you encounter any issues or have suggestions, please open an issue on GitHub.

---

**Happy Documenting! 📚✨**