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

@fgbg/mdocs

v0.7.6

Published

A Markdown knowledge base for small teams

Downloads

1,491

Readme

mdocs

Markdown knowledge base for small teams.

  • TypeScript front-end and back-end
  • Vite + React web, Express back-end
  • SQLite metadata, Markdown files as primary storage
  • Lightweight visitor identity, no account system
  • Runs locally or on a small team server

文档站点:xuhuafeifei.github.io/mdocs-site

编辑界面图片: 上述文章是通过mdocs-cli由agent阅读Deepseek-TUI代码后推送的

后台界面

Clean-room policy

mdocs is implemented from scratch. It MUST NOT reuse any code from markdown-docs (located at ~/ddmc/markdown-docs). That includes, but is not limited to:

  • Source files, functions, classes, interfaces, types
  • SQL statements or schema definitions
  • React components, hooks, CSS
  • Utility helpers and configuration shapes
  • API route wiring or identity logic

Reuse of the agent-demo logger design is permitted because it is the author's own demo project.

The Meta2d / Vditor flow matches markdown-docs: useFlowRenderer, registerPens, fenced ```meta2 blocks with inline JSON, wysiwyg mode (not IR), SVG preview in the preview half of each block, and window.vditorInstance for getValue / setValue when editing or deleting blocks.

Diagrams (Meta2d in Markdown)

Diagrams live in the .md source as fenced blocks:

```meta2
{ "pens": [ … ] }
```

The editor renders them as SVG (via canvas2svg + Meta2d, same approach as markdown-docs). Saving the modal rewrites that JSON in the document with Vditor#setValue. Use the toolbar Insert diagram (or double-click a diagram). Switch edit-mode / both in the Vditor toolbar for source vs wysiwyg. Large documents: API JSON body limit is 32 MiB.

Layout

src/
  server/    Node back-end
  web/       Vite React front-end
  shared/    Cross-cutting types and schemas

Runtime data lives under ~/.mdocs/:

~/.mdocs/
  data.sqlite
  files/
    docs/
    assets/
  logs/

domain_id is a logical grouping inside SQLite and does not appear in file paths. Moving a document between domains only updates the database.

Development

pnpm install
pnpm dev:server   # http://localhost:4000
pnpm dev:web      # http://localhost:5173, proxies /api

Build and run

pnpm build
pnpm start        # serves web static files and /api on one port

Visitor identity

On first visit the user enters a nickname. The server issues a visitor_id (UUID) and a high-entropy visitor_token. The browser keeps the raw token; the server only stores SHA-256(token). Each request sends the raw token in an x-visitor-token header; the server hashes it and looks up the visitor.

Visitor migration

If the browser cache is cleared a user will register a new visitor. An administrator can merge the old identity into the new one:

pnpm mdocs visitor migrate --from OLD_VISITOR_ID --to NEW_VISITOR_ID --dry-run
pnpm mdocs visitor migrate --from OLD_VISITOR_ID --to NEW_VISITOR_ID --confirm

The script backs up the SQLite file, runs inside a transaction, updates ownership, disables the old visitor, and appends an entry to visitor_migrations and audit_logs. Markdown files are never moved.