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

@mdxstudio/cli

v0.3.0

Published

Browse a whole folder of MDX and Markdown documents in the browser, with a navigable sidebar and live reload.

Downloads

989

Readme

@mdxstudio/cli

Read a folder of MDX documents in your browser. Point it at a directory, get a sidebar of everything in it, and edits show up without a refresh.

npx @mdxstudio/cli serve ./docs

No install, no config, no build step in the folder you are reading — it does not need to be a JavaScript project at all.

mdxstudio serve: file sidebar on the left, a rendered document with an interactive flow diagram on the right

Clicking between documents, with the table of contents following along:

Navigating between documents in the sidebar

Every Mermaid diagram type renders, including inside <Tabs>:

Clicking across tabs, each drawing a different Mermaid diagram

Commands

mdxstudio serve [dir]          # default '.'
mdxstudio ./docs               # a bare path implies serve
mdxstudio open <file>          # one document
cat draft.mdx | mdxstudio open -   # from stdin

| Flag | | | --- | --- | | -p, --port <n> | Default 4321. Without this it walks forward to the next free port; with it, a taken port is an error. | | -H, --host[=addr] | Bare --host binds 0.0.0.0. An explicit address needs the =. | | -o, --open / --no-open | Open a browser. | | --no-watch | Stop watching for changes. | | --no-gitignore | Include files .gitignore excludes. | | --no-collapse | Headings do not fold. The control that copies a heading link stays. | | --expressions full\|literals | See below. | | --theme <id> | One of the built-in theme presets. |

What you get

  • A sidebar of every .mdx and .md under the directory, with a filter box. .gitignore is respected and node_modules is skipped.
  • Live reload — editing, adding, renaming or deleting a file updates the page.
  • The full component set: Mermaid diagrams, Recharts charts, FlowGraph, callouts, tabs, accordions, timelines, frontmatter headers, and a scroll-spy table of contents.
  • The markdown you already write: $math$, GitHub's > [!NOTE] alerts, and images that open enlarged when clicked. KaTeX is fetched only by documents that contain an equation.
  • Readable on a phone — pass --host and open the LAN URL it prints.

Starts in about 250 ms; the client is prebuilt, so nothing compiles on startup.

Configuration

A folder may contain an mdxstudio.config.js (or .mjs). Without one nothing changes; with one, its default export adds components, aliases, code fences and unified plugins to the renderer.

It is the same file the MDX Studio Preview extension for VS Code reads out of a workspace folder — same two names, same default export, same { React, createElement, components } argument — so a repository writes it once and its documents look the same on the command line and in the editor.

// docs/mdxstudio.config.js
export default ({ createElement }) => ({
  components: {
    Chip: ({ children }) => createElement('span', { className: 'chip' }, children),
  },
  aliases: { Pill: 'Chip' },
  codeFences: { graphviz: 'Chip' },
  remarkPlugins: [],
  rehypePlugins: [],
});

The default export is either that object or a function returning one, which may be async. Everything is optional; a component registered under a built-in name replaces it.

The config runs in the browser, because that is where the renderer is — so it cannot import from node_modules, and there is no bundler to compile JSX. Two consequences:

  • Build elements with createElement rather than JSX, or import a package from a URL (import confetti from 'https://esm.sh/canvas-confetti').
  • A remark or rehype plugin is a plain function, so the useful ones usually need no dependency at all.

The function form is called with { React, createElement, components }, where components is everything already registered — enough to wrap or replace a built-in.

If the file is missing the CLI behaves exactly as it did before. If it throws, fails to import, or declares an alias pointing at nothing, the documents still render with the built-in components and the page shows one line naming the file and the reason.

One difference worth knowing if you also use the extension: the CLI loads the config for any folder you point it at, because you typed the path. VS Code will not load one in a workspace you have not trusted.

Expressions

MDX documents can contain JavaScript expressions, and rendering them means evaluating them. Serving a repository you already trust as much as its code, full is the sensible default and is what you get.

mdxstudio serve ./docs --expressions literals

literals restricts evaluation to values the syntax spells out — no calls, no member access. Worth using for a folder you have not read, which matters more once --host puts it on your network.

Related

MIT.