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

@doidor/markbook

v0.5.0

Published

Markbook CLI — build static documentation sites from markdown + component stories

Downloads

1,167

Readme

markbook — CLI

The command-line entry point for Markbook. Loads markbook.config.{ts,mts,js,mjs} from the project root and orchestrates @doidor/markbook-core to build, serve, or bundle your docs.

Install

npm install -D @doidor/markbook @doidor/markbook-core
pnpm add -D @doidor/markbook @doidor/markbook-core
yarn add -D @doidor/markbook @doidor/markbook-core

Pair with the React adapter (@doidor/markbook-adapter-react). Vue and Web Components adapters are planned but not yet available.

Commands

markbook build                  # static site in dist/
markbook dev                    # dev server with HMR
markbook bundle [storyId]       # portable bundles in dist/embed/ or dist/packages/

markbook build

Generate the static documentation site.

| Flag | Default | Description | | --- | --- | --- | | -c, --config <path> | auto-discovered | Path to markbook.config.{ts,mts,js,mjs} | | --root <path> | cwd | Project root |

Output goes to dist/ (configurable via outDir):

dist/
  index.html
  <pages>/<name>.html       # one HTML file per .md
  assets/                   # Vite-hashed JS/CSS chunks
  pagefind/                 # Pagefind search index + UI
  llms.txt                  # llmstxt.org-format summary
  llms/<page>.txt           # per-page plain-text mirror

markbook dev

Start the Vite-backed dev server. Watches markdown, templates, story files, and user CSS via chokidar; component/story .tsx/.ts files hot-reload through Vite.

| Flag | Default | Description | | --- | --- | --- | | -c, --config <path> | auto-discovered | Path to config | | --root <path> | cwd | Project root | | --port <port> | 5173 | Port to bind to | | --host <host> | (Vite default) | Host to bind to |

markbook bundle [storyId]

Bundle stories as portable artefacts. Without storyId, bundles every story in the workspace; with one, only the matching slug.

| Flag | Default | Description | | --- | --- | --- | | -c, --config <path> | auto-discovered | Path to config | | --root <path> | cwd | Project root | | --mode <mode> | embed | embed (self-mounting ESM) or package (publishable npm) | | --isolation <mode> | none | shadow to mount each story inside an open shadow root |

embed mode writes dist/embed/<slug>.js. Each bundle auto-mounts on every <div data-markbook-embed="<slug>"> placeholder it finds in the host page — drop in one <script type="module"> and you're done.

package mode writes dist/packages/<slug>/ as a publishable npm package (package.json, dist/index.js, README.md). The framework runtime stays external as a peer dependency, so the consumer's React is reused.

--isolation=shadow wraps each mount in attachShadow({ mode: 'open' }) so host-page CSS doesn't leak in.

markbook skills <action>

Distribute Markbook's user-facing agent skills (procedural how-tos for agent CLIs like Claude Code, Codex, OpenCode, Cursor) into the consumer project's vendor surfaces. See ADR-0022 for design.

markbook skills install      # copy shipped skills into <vendor>/skills/markbook-<name>/
markbook skills list         # show shipped + installed, flag out-of-date

| Flag | Default | Description | | --- | --- | --- | | --root <path> | cwd | Project root | | --surface <name> | detected | Limit to .claude / .codex / .opencode / .agents | | --symlink | off (copy) | Symlink rather than copy. Avoid on Windows or pnpm. | | --update | off | Refresh installed skills whose shipped content changed | | --force | off | Overwrite skill dirs that lack our .markbook-skill.json metadata |

Behaviour:

  • Copy by default. Symlinks dangle on pnpm's .pnpm/<hash> paths and on Windows. Each install drops a .markbook-skill.json recording the source hash + markbook version so --update is deterministic.
  • Flat namespace. Skills land at <surface>/skills/markbook-init/ (not <surface>/skills/markbook/init/) for cross-vendor portability.
  • Detect surfaces; don't create all four. If your repo has only .claude/, only that gets a copy. If none exist, defaults to .claude/.
  • Refuses to clobber unmanaged content. A pre-existing <surface>/skills/markbook-init/ without our metadata is reported skipped-unmanaged--force to override.

Shipped skills (v1):

| Skill | Purpose | | --- | --- | | markbook-init | Scaffold a new Markbook docs site (config + first page + sample story) | | markbook-add-component-page | Generate one docs page for one component | | markbook-bulk-generate | Bulk-generate docs pages for every component under a directory (dry-run default) | | markbook-style | Apply a visual preset (minimal / vibrant / corporate / github / nord) + optional --accent / --font overrides | | markbook-layout | Scaffold a custom HTML layout (docs / marketing / blog / minimal template) with all required {{ }} placeholders pre-wired, and register it in markbook.config.ts | | markbook-bundle-story | Walk through markbook bundle for embedding stories externally |

Per-skill walkthrough with examples is in the agent skills guide; every flag of every skill is in the skills reference.

After running markbook skills install, agents that auto-discover skills from those vendor directories will pick them up. Invocation syntax depends on the agent — /markbook-init, @markbook-init, etc.

Exit codes

| Code | Meaning | | --- | --- | | 0 | Success | | 1 | Build / dev / bundle failed (stack trace printed to stderr) |