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

codedoc-mermaid-plugin

v1.0.0

Published

Mermaid plugin for Codedoc.

Readme

codedoc-mermaid-plugin

This plugin enables the use of Mermaid diagrams in Codedoc documents.

Installation

Using the Codedoc CLI, run the following command inside your project's folder:

$ codedoc install codedoc-mermaid-plugin

Configuration

To use the plugin, first edit your config.ts file like below. Make sure you import the plugin at the top of the file, and then add it to the plugins section in the configuration function.

import { configuration } from '@codedoc/core';
import { mermaidPlugin } from 'codedoc-mermaid-plugin' // --> import the plugin
import { theme } from './theme';

export const config = /*#__PURE__*/configuration({
    theme,
    page: {
        title: {
            base: 'Mermaid Plugin'
        }
    },
    plugins: [
        mermaidPlugin()   // --> make sure you add this section
    ]
});

Customizing Configuration

Mermaid's configuration can be changed by passing a MermaidOptions object to the mermaidPlugin() function. Basically all the options described here are supported.

For example, if you wanted to change the theme to neutral and to change the spacing between flowchart nodes, you would do this:

// imports removed for brevity
export const config = /*#__PURE__*/configuration({
    theme,
    page: {
        title: {
            base: 'Mermaid Plugin'
        }
    },
    plugins: [
        mermaidPlugin({
            theme: "neutral",
            flowchart: {
                nodeSpacing: 75
            }
        })
    ]
});

Usage

To render diagrams in your documents, all you need to do is wrap Mermaid's diagram syntax in markdown block-quote elements (Codedoc calls them "quoted components") like below:

> :Mermaid
> > graph LR
> >   Start --> End

Another way to do it is with just one > sign, but you must add a blank line below :Mermaid:

> :Mermaid
>
> graph LR
>   Start --> End

Refer to the "Diagram Syntax" section of Mermaid's documentation to learn how to use each of the diagrams.

Contributing

If you'd like to contribute to this plugin, here are some ideas for improvements:

  1. Add some styling so the diagrams can be rendered inside some container, similar to the code blocks.
  2. Find a way to dynamically change the theme when switching between light/dark mode. Right now the neutral theme is the one that works best with both modes.

License

MIT