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

markmap-export-cli

v0.1.0

Published

CLI tool to convert Markdown to mindmap SVG using markmap-lib

Downloads

108

Readme

markmap-export-cli

CLI tool to convert Markdown to interactive mindmap SVG using markmap-lib.

Installation

Global Installation

npm install -g markmap-export-cli

Using npx (No Installation)

npx markmap-export-cli --input "# Hello\n\n## World"

Usage

Basic Usage

# Direct markdown input
markmap-export-cli --input "# Hello\n\n## World\n\n- Item 1\n- Item 2"

# From file
markmap-export-cli --input input.md --output output.svg

# With custom dimensions
markmap-export-cli --input input.md --width 1600 --height 1200

Command Line Options

| Option | Description | Default | |--------|-------------|---------| | -i, --input <input> | Markdown content or .md file path (required) | - | | -o, --output <output> | Output SVG file path | output.svg | | -W, --width <width> | Output width in pixels | 1200 | | -H, --height <height> | Output height in pixels | Auto | | -t, --theme <theme> | Theme (default or dark) | default |

Programmatic Usage

const { exportToSvg } = require('markmap-export-cli');

async function main() {
  const result = await exportToSvg({
    input: '# Hello\n\n## World',
    output: 'mindmap.svg',
    width: 1200,
    height: 800
  });

  if (result.success) {
    console.log('Exported to:', result.filePath);
  } else {
    console.error('Error:', result.error);
  }
}

main();

Installing Chrome

markmap-export-cli requires a Chrome/Chromium browser to render the mindmap. You have two options:

Option 1: Let Puppeteer Download Chrome (Default)

By default, Puppeteer will automatically download a compatible version of Chromium during installation. No manual action required.

Option 2: Install Chrome/Chromium Manually

If you prefer to use your own Chrome installation (e.g., to save disk space or for faster installs), follow these steps:

Install Google Chrome

macOS:

# Using Homebrew
brew install --cask google-chrome

# Or download from: https://www.google.com/chrome/

Windows:

# Using winget
winget install Google.Chrome

# Using Chocolatey
choco install googlechrome

# Or download from: https://www.google.com/chrome/

Linux (Ubuntu/Debian):

# Download and install Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

# Or install Chromium (open-source version)
sudo apt install chromium-browser

Linux (Fedora/CentOS/RHEL):

# Install Chromium
sudo dnf install chromium

# Or for Google Chrome
sudo dnf install fedora-workstation-repositories
sudo dnf config-manager --set-enabled google-chrome
sudo dnf install google-chrome-stable

Alternative: Install Chromium

Chromium is the open-source version of Chrome and works equally well:

  • macOS: brew install --cask chromium
  • Windows: Download from https://www.chromium.org/getting-involved/download-chromium
  • Linux: Available in most package managers as chromium or chromium-browser

After installing Chrome/Chromium, see Using System Chrome below for configuration.

Using System Chrome (Skip Puppeteer Download)

If you don't want Puppeteer to download Chrome (e.g., slow network or disk space concerns), you can use your existing Chrome/Chromium browser:

1. Skip Chrome Download During Install

# Skip automatic Chrome download
PUPPETEER_SKIP_DOWNLOAD=true npm install -g markmap-export-cli

2. Configure Chrome Path

Set the PUPPETEER_EXECUTABLE_PATH environment variable to your Chrome executable:

macOS:

# Google Chrome (stable)
export PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

# Google Chrome Canary
export PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"

# Microsoft Edge
export PUPPETEER_EXECUTABLE_PATH="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"

Windows:

REM Google Chrome
set PUPPETEER_EXECUTABLE_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe"

REM Microsoft Edge
set PUPPETEER_EXECUTABLE_PATH="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"

Linux:

# Google Chrome
export PUPPETEER_EXECUTABLE_PATH="/usr/bin/google-chrome"

# Chromium
export PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"

# Microsoft Edge
export PUPPETEER_EXECUTABLE_PATH="/usr/bin/microsoft-edge"

3. Use the CLI

markmap-export-cli --input "# Hello\n\n## World"

Environment Variables

| Variable | Description | |----------|-------------| | PUPPETEER_EXECUTABLE_PATH | Path to custom Chrome/Chromium executable | | PUPPETEER_SKIP_DOWNLOAD | Set to true to skip Chrome download during install | | MARKMAP_OFFLINE | Set to true to use offline mode (embedded assets) |

Requirements

  • Node.js >= 16
  • Chrome/Chromium browser (auto-downloaded by Puppeteer, or use system Chrome)

How It Works

  1. Parse Markdown content using markmap-lib
  2. Generate HTML with embedded mindmap visualization
  3. Use Puppeteer to render the HTML and extract SVG
  4. Save the SVG file to the specified output path

License

MIT