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

@alikhan-devs/docify

v1.3.0

Published

Zero-config Express.js middleware that automatically generates API documentation from runtime usage

Readme

< Turn any Express API into live documentation in 2 lines.


Dashboard Image of Docify

⚡ Quick Start

npm install docify
const express = require('express');
const docify = require('@alikhan-devs/docify');

const app = express();
app.use(express.json());

// One line — that's it!
app.use(docify());

// Your existing routes work as before
app.get('/api/users', (req, res) => { /* ... */ });
app.post('/api/users', (req, res) => { /* ... */ });

app.listen(3000);
// Visit http://localhost:3000/docs to see your auto-generated API docs!

🎯 How It Works

  1. You install Docify and add it as Express middleware
  2. You develop normally — no annotations, no schemas, no changes to your code
  3. Docify observes every API request and response flowing through your app
  4. Documentation is generated automatically and served at /docs
  5. Live updates — as you make more API calls, docs update in real-time via SSE

📋 Configuration

app.use(docify({
  docsPath: '/docs',          // URL path for documentation UI (default: '/docs')
  sanitize: true,             // Mask sensitive fields like passwords/tokens (default: true)
  enabled: true,              // Master switch (default: true)
  maxExamples: 5,             // Max request/response examples per endpoint (default: 5)
  sensitiveFields: [],        // Additional field names to redact (default: [])
  ignorePaths: ['/health'],   // Paths to exclude from capture (default: [])
  captureHeaders: false,      // Whether to capture req/res headers (default: false)
  persist: true,              // Keep captured docs after server restarts (default: true)
  storagePath: '.docify/docify.json', // Optional custom persistence file
}));

Environment Variables

| Variable | Description | |---|---| | DOCIFY_ENABLED=false | Disable Docify entirely (useful for production) | | DOCIFY_DEBUG=true | Enable internal debug logging |

🏗️ Architecture

Express Request → Capture Middleware → Sanitizer → Route Registry → Doc Generator → UI

| Module | Responsibility | |---|---| | Capture Middleware | Intercepts res.write/res.end to capture response bodies non-destructively | | Route Registry | In-memory store that groups API calls by normalized routes, detects parameterized paths | | Sanitizer | Deep-scans objects and masks sensitive fields (password, token, secret, etc.) | | Doc Generator | Transforms registry data into structured, sorted, grouped JSON | | UI Server | Serves a self-contained HTML documentation page with SSE live updates |

Persistent Docs, Cleanup, and Try It

Docify now stores captured documentation in .docify/docify.json by default, so restarting your backend does not wipe the generated docs. Set persist: false if you only want in-memory docs during tests or short-lived sessions.

If a wrong request is captured, such as GET /users when the endpoint should be POST /users, open the endpoint in the UI and use the delete button to remove only that captured route.

Each endpoint page also includes a try panel. You can edit the method, path, query string, and JSON body, then run the request against the live backend and see the real response immediately.

Parameterized Route Detection

Docify automatically detects dynamic URL segments:

  • /users/123/users/:id
  • /users/550e8400-e29b-41d4-a716-446655440000/users/:id
  • /users/507f1f77bcf86cd799439011/users/:id

🔒 Security

  • Sensitive fields are masked by default — passwords, tokens, API keys, secrets are replaced with [REDACTED]
  • No external network calls — all data stays in-process memory
  • Response body size limit — bodies >1MB are truncated
  • Self-exclusion — Docify's own routes are never captured
  • Production disable — set DOCIFY_ENABLED=false in production

Default Redacted Fields

password, token, access_token, refresh_token, api_key, secret, authorization, cookie, session, credit_card, card_number, cvv, ssn, private_key, x-api-key

📡 API Endpoints

When Docify is mounted, these routes are available:

| Route | Description | |---|---| | GET /docs | Documentation UI | | GET /docs/api.json | Raw JSON API catalog (SDK-friendly) | | GET /docs/stream | Server-Sent Events stream for live updates | | DELETE /docs/api.json | Clear all captured data | | DELETE /docs/endpoint | Delete one captured endpoint by method and path | | POST /docs/try | Run an endpoint against the live backend from the docs UI |

🧪 Running the Example

cd example
npm install
npm start

Then make some API calls:

curl http://localhost:3000/api/users
curl -X POST http://localhost:3000/api/users -H "Content-Type: application/json" -d '{"name":"Alice","email":"[email protected]"}'
curl http://localhost:3000/api/products?category=electronics
curl -X POST http://localhost:3000/api/auth/login -H "Content-Type: application/json" -d '{"email":"[email protected]","password":"secret"}'

Visit http://localhost:3000/docs to see the auto-generated documentation!

📄 License

MIT