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

ink-mermaid

v0.1.1

Published

Render Mermaid diagrams as ASCII/Unicode in Ink-based terminal UIs.

Downloads

140

Readme

ink-mermaid

npm version CI License: MIT

Render Mermaid diagrams as ASCII/Unicode in Ink-based terminal UIs.

A thin Ink wrapper around beautiful-mermaid. No browser, no headless Chrome, no external CLI — pure TypeScript, runs anywhere Node runs.

Install

npm install ink-mermaid ink react

ink and react are peer dependencies.

Usage

import React from 'react';
import {render, Box, Text} from 'ink';
import {Mermaid} from 'ink-mermaid';

const code = `graph LR
  A[Start] --> B{Decision}
  B -->|Yes| C[Action 1]
  B -->|No| D[Action 2]
  C --> E[End]
  D --> E`;

function App() {
  return (
    <Box flexDirection="column">
      <Text bold>My diagram</Text>
      <Mermaid code={code} />
    </Box>
  );
}

render(<App />);

Output:

┌───────┐     ◇──────────◇        ┌──────────┐     ┌─────┐
│ Start ├────►│ Decision │ ├─Yes─►│ Action 1 ├────►│ End │
└───────┘     ◇─────┬────◇        └──────────┘     └─────┘
                    │                                 ▲
                    │             ┌──────────┐        │
                    └─────No─────►│ Action 2 ├────────┘
                                  └──────────┘

Props

| Prop | Type | Description | | ---------- | ----------------------------------- | -------------------------------------------------------------------------- | | code | string | Mermaid source code. Required. | | useAscii | boolean | Use plain ASCII (+, -, \|) instead of Unicode box-drawing characters. | | options | RenderOptions | Extra options forwarded to beautiful-mermaid (padding, color mode, ...). | | fallback | (error: Error) => ReactNode | Rendered when the Mermaid source fails to parse. | | onError | (error: Error) => void | Called when the Mermaid source fails to parse. |

Supported diagram types

Whatever beautiful-mermaid supports — currently Flowchart, State, Sequence, Class, ER, and XY charts. See the beautiful-mermaid docs for the authoritative list.

Known upstream issues

These limitations come from beautiful-mermaid, not from ink-mermaid. The corresponding tests in this repo are marked with test.failing() so they automatically flip green once the upstream library fixes them.

  • --o and --x edge styles drop the target node (as of [email protected]). Example: graph LR; A --o B renders only A. Tracked at lukilabs/beautiful-mermaid#109.
  • Diagram types not supported by beautiful-mermaid produce a parse error, which <Mermaid> surfaces via fallback / onError. Currently affected: pie, gantt, journey, mindmap.

License notice

This package is MIT. The underlying beautiful-mermaid is MIT, and its layout engine elkjs is EPL-2.0. Using ink-mermaid as a runtime dependency does not trigger EPL obligations.

Run the example

git clone https://github.com/mk668a/ink-mermaid
cd ink-mermaid
npm install
npm run example