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

mdart

v0.3.0

Published

MdArt — markdown-native diagram DSL renderer

Readme

mdart

Core renderer and parser for the MdArt diagram DSL.

```mdart
type: org-chart
title: Engineering Team

- CTO
  - Frontend
  - Backend
  - Platform
```

Full syntax documentation with rendered examples for all 97 layout types, color overrides, and modifier attrs: docs/syntax.md

Install

npm install mdart

Usage

Render a diagram

import { renderMdArt } from 'mdart'

const svg = renderMdArt(`
type: org-chart
title: Engineering

- CTO
  - Frontend
  - Backend
  - Platform
`)

// svg is a self-contained <svg>...</svg> string, ready to inject into the DOM
document.body.innerHTML = svg

An optional second argument hints the layout type when you're rendering a bare source string without front-matter:

const svg = renderMdArt('Plan → Build → Measure → Learn', 'cycle')

Parse without rendering

import { parseMdArt } from 'mdart'
import type { MdArtSpec } from 'mdart'

const spec: MdArtSpec = parseMdArt(`
type: kanban

- Backlog
  - Write docs
  - Fix bug #42
- In Progress
  - Add tests
- Done
  - Initial release
`)

Browser tab interactivity

Layouts with multiple tabs (e.g. tab-list) need a small client-side script to wire click handlers. Import from the mdart/preview subpath so bundlers can tree-shake it out of server builds:

import { tryActivateMdArtTabFromEventTarget } from 'mdart/preview'

document.addEventListener('click', (e) => {
  tryActivateMdArtTabFromEventTarget(e.target)
})

API

renderMdArt(source, hintType?, pluginConfig?)

| Parameter | Type | Description | |---|---|---| | source | string | MdArt DSL source (with or without front-matter) | | hintType | string \| undefined | Layout type hint (overridden by front-matter type:) | | pluginConfig | MdArtConfig \| undefined | Plugin-level config (overrides global, below per-fence) |

Returns a string containing a self-contained SVG element.

Throws if the source cannot be parsed or the layout type is unknown.

parseMdArt(source)

Returns an MdArtSpec object with the parsed type, title, theme, and items.

configureMdArt(config)

Sets global defaults applied to every renderMdArt() call. Subsequent calls replace (not merge) the previous config.

| Field | Type | Description | |---|---|---| | theme | string \| undefined | Default theme name | | colors | Partial<MdArtTheme> \| undefined | Default color overrides |

resetMdArtConfig()

Resets global config to empty defaults. Primarily for use in tests.

Themes

Each diagram family has a built-in color scheme. Override it per fence, globally, or at the plugin level.

Named themes

mono-light · mono-dark · cyan · emerald · violet · lavender · amber · orange · rose · blue · sky

type: process
theme: emerald

Step 1 → Step 2 → Step 3

Global configuration

import { configureMdArt, resetMdArtConfig } from 'mdart'

// Apply to all diagrams in this process
configureMdArt({ theme: 'mono-light' })

// Or override individual colors
configureMdArt({ colors: { primary: '#6366f1', bg: '#0f172a' } })

// Reset (useful in tests)
resetMdArtConfig()

License

MIT