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

@comp-markdown/mermaid

v0.1.1

Published

A CompMD pack that draws Mermaid diagrams, ```mermaid blocks and diagrams computed from data, with Mermaid 12.2.0 bundled in, in the host's strict sandbox.

Readme

@comp-markdown/mermaid

A CompMD pack that draws Mermaid diagrams in any document that imports it, with no support from the host: ```mermaid blocks, and diagrams computed from the document's data. It bundles Mermaid 12.2.0 as one module, which runs in the host's strict sandbox. The design is docs/mermaid-pack.md.

Use it in a document

---
md:
  import:
    - from: "@comp-markdown/mermaid@0"
      names: [mermaid]
steps: [Draft, Review, Published]
---

```mermaid {alt="Draft, then review, then published"}
graph LR
  Draft --> Review --> Published
```

:: mermaid[The steps: draft, review, published] {code=("graph TD; " + md.doc.steps.join(" --> "))}
  • A block of ```mermaid or ```mmd is drawn; its alt is the drawing's text alternative. A reader without the pack, and GitHub, see the code (GitHub draws it too).
  • A leaf takes the diagram's source as its code param, for a diagram made from data or inputs: a code block is never interpolated.
  • theme: auto (the default) follows the page: Mermaid's dark theme on a dark page, its default theme on a light one. default, dark, neutral and forest are Mermaid's themes, as given: ```mermaid {theme=forest}.
  • A diagram Mermaid can't read shows its code, and the host reports what Mermaid found as W118 (an editor shows it on the block); the diagram draws again once the code is fixed.

Size

dist/mermaid.js is 7.0 MB minified, 1.6 MB gzipped (measured 2026-11-02): all of Mermaid's diagram types, with the ELK layout engine (2.5 MB of it before minifying), in one file, so a host can load it by URL or as text. A host fetches it once per version, and only for documents that import it. @compmd/registry's default size cap is 10 MB.

Licences

The pack is MIT. dist/LICENSES.md lists what its module bundles, each with its licence: Mermaid (MIT) and the libraries it uses.

Try it

From the repository (pnpm install at its root first):

pnpm --dir packs/mermaid dev     # the test page, demo.comp.md in host mode, each diagram in a strict frame, with a light and dark switch
pnpm --dir packs/mermaid test    # the build, the component in happy-dom, the test page in Chrome and WebKit, and the pack from a local registry
pnpm --dir packs/mermaid lint    # the type check

The build, its checks and the test page are @compmd/pack's, as for any pack: the pack holds its component (src/mermaid.ts, on draw), its signature, demo.comp.md and its tests. Its browser tests (test/) are this repository's checks of the sandbox and the registry with a real library; a pack's own tests are the unit tests.

Releases

The pack has its own version, for its component's params and forms; a new Mermaid is a new version of the pack. A tag mermaid-v<version> publishes it from CI (RELEASING.md).

  • 0.1.1: the same as 0.1.0; the first version the release workflow publishes, which proves its trusted publishing.
  • 0.1.0: the first version, published by hand.