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

mdlook

v0.1.1

Published

Markdown previewer with real mermaid diagrams — inline in your terminal or in a popup window with live reload

Downloads

344

Readme

mdlook

Markdown previews with real mermaid diagrams — inline in your terminal, or in a standalone popup window with live reload.

mdlook README.md         # rich render in the terminal, diagrams as actual images
mdlookw README.md        # chromeless popup window, live-reloads on save
cat notes.md | mdlook -  # stdin

Why

Terminal markdown viewers don't render mermaid (glow's most-requested features are inline images and mermaid support). Browser previewers don't live in your terminal. mdlook does both, with one tiny CLI:

  • Terminal mode: GitHub-flavored rendering with distinct heading levels, shaded code panels (theme-aware — it asks your terminal for its background color), colored lists, task-list checkboxes, emoji shortcodes — and mermaid diagrams rendered to PNG and displayed inline via the Kitty graphics protocol.
  • Popup mode: a chromeless app window (plain Chrome --app, no Electron) with GitHub styling, client-side mermaid, syntax highlighting, a dark-mode toggle, and live reload that survives editors' atomic saves.
  • GitHub extras in both modes: alerts (> [!NOTE], [!TIP], [!WARNING], ...) with proper colors and titles; YAML frontmatter is recognized and tucked away (collapsible in the popup) instead of rendering as garbage.

Everything renders locally — no CDN, no external services; your documents never leave your machine.

Install

npm install -g mdlook

Requirements:

  • Node ≥ 22
  • Google Chrome or Chromium (used headlessly for diagram rendering and for the popup window). Auto-discovered on macOS/Linux/Windows; override with CHROME_PATH.

Without Chrome, terminal mode still works — mermaid blocks fall back to plain fences.

Terminal support for inline images

Diagrams render inline in terminals that speak the Kitty graphics protocol: Kitty, Ghostty, WezTerm, Konsole. Other terminals (iTerm2, VS Code, Terminal.app, Windows Terminal) automatically fall back to showing the diagram source — no garbage, no missing content. Inside tmux, images are disabled.

Usage

| Command / flag | What it does | |---------------------|------------------------------------------------------------| | mdlook FILE.md | render in the terminal | | mdlookw FILE.md | popup window with live reload (same as mdlook -w) | | mdlook - | read from stdin | | --no-images | terminal mode: show mermaid/image sources as plain fences | | --refresh | re-render mermaid diagrams, ignoring the cache | | --plain | minimal styling (GitHub-faithful, no color accents) | | --pager / --no-pager | force / suppress paging; long docs auto-page when images are off | | --port N | fixed port for popup mode (default: random) |

Environment: CHROME_PATH points at a Chrome/Chromium binary; MDLOOK_NO_OPEN=1 starts the popup server without opening a window.

How it works

flowchart LR
    CLI[bin/mdlook.js] -->|default| T[src/terminal.js<br/>marked + kitty graphics]
    CLI -->|-w| S[src/server.js<br/>markdown-it + SSE reload]
    T --> M[src/mermaid.js<br/>headless Chrome + sha256 cache]
    S -->|mermaid.js client-side| W[Chrome --app window]
  • Mermaid PNGs are rendered by one shared headless Chrome (via puppeteer-core driving your system browser — no bundled Chromium download) and cached at ~/.cache/mdlook/mermaid/ by content hash, so repeat previews are instant. Broken diagrams are negative-cached so they fail fast; theme is part of the cache key.
  • The popup is plain Chrome launched with --app= and a dedicated profile; closing the window shuts the server down within a few seconds.
  • Live reload watches the file's directory (not the file), so atomic saves from VS Code/IntelliJ don't kill the watcher; the page swaps content over SSE and preserves your scroll position.
  • Dark mode: terminal diagrams and code panels follow your terminal's detected background; the popup follows the OS, with a manual toggle persisted across runs.

License

MIT