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

@bobfrankston/mdview

v0.1.15

Published

Render a markdown file and display it via msger or msgview

Downloads

1,759

Readme

mdview

Render a markdown file (or stdin) and display it in a window via msger (Rust/wry, default) or msgview (Electron).

Why

msger and msgview are HTML viewers — they don't auto-render markdown. mdview is the preprocessor: it renders the .md to a self-contained HTML document (via msgcommon's renderMarkdown), injects a <base href> so relative links and images resolve against the source file's directory, and hands the HTML to whichever host you pick.

The HTML is loaded raw (-raw / rawHtml: true) — no msger/msgview template, no buttons. Just the rendered page in a window.

Install

npm install -g @bobfrankston/mdview

This pulls msger as a dependency, so the default host works out of the box. To use the -host msgview backend you must install msgview separately:

npm install -g @bobfrankston/msgview

Usage

mdview [options] <file.md> [-- <host-flags>...]
cat foo.md | mdview -stream [options] [-- <host-flags>...]

Options

Window:

| Flag | Description | |---|---| | -pos x,y[,s] | Window position (screen index s is optional, Windows only). | | -size w,h | Window size in pixels. | | -ontop | Keep window above others. | | -zoom <percent> | Initial zoom (e.g. -zoom 150). |

Behavior:

| Flag | Description | |---|---| | -host msger\|msgview | Backend host. Default: msger. Persisted to ~/.mdview.json. | | -w, -watch | Re-render and reload when the file changes on disk. Implies -nodetach. | | -stream | Read markdown from stdin instead of a file. | | -save <file> | Render to <file> (HTML) and exit; don't open a window. | | -nodetach | Wait for the window to close before exiting. Default is detach (mdview returns immediately). | | -dev | Open developer tools on startup. | | -h, -help | Show help. |

Both -foo and --foo forms are accepted.

Host pass-through flags

Anything after -- is forwarded to the host. Needed only for flags mdview doesn't expose directly:

mdview README.md -- -reset

mdview's own -pos, -size, -ontop, -zoom, -dev are translated for both hosts natively. Passthrough flags override top-level (last-write-wins) if you specify both.

Examples

# Default (msger), one-shot — shell returns immediately (detach is the default)
mdview README.md

# Switch to msgview and remember the choice
mdview -host msgview notes.md
mdview notes.md            # subsequent runs use msgview until you switch back

# Pin position/size/ontop directly (no `--` needed)
mdview README.md -pos 100,100 -size 1000,800 -ontop

# Wait for the window to close (scripting)
mdview README.md -nodetach

# Watch mode — reloads on save, stays attached
mdview -w draft.md

# Render and save HTML, no window
mdview README.md -save out.html

# Pipe from stdin
cat foo.md | mdview -stream
gh pr view --json body -q .body | mdview -stream

How it works

  1. Read the markdown source (file or stdin)
  2. Render to a complete HTML document via renderMarkdown(md, title, baseHref) from msgcommon
  3. <base href="file:///<source-dir>/"> is injected into <head> — relative [link](./other.md) and ![img](./pic.png) resolve against the source directory
  4. Pass HTML + rawHtml: true to the host:
    • msger: programmatic showMessageBoxEx API → stdin JSON to the Rust binary (no command-line length limit)
    • msgview: spawn('msgview', ['-raw', '-html', html, ...]) (subject to Windows cmd.exe ~8k arg limit; use msger for large docs)

Limits

  • Watch mode respawns the window — geometry resets each reload. Pin it with -pos x,y -size w,h.
  • msgview + huge HTML can hit the 8k cmd.exe arg limit on Windows. Switch to msger if rendering is silently truncated.
  • Cross-file [x](other.md) links navigate to the raw .md file, not the rendered version. The host loads it as text. (Future: intercept .md navigation and re-render.)
  • Explicit refresh is editor-driven via watch mode — touch the file to force a reload without changing it.

Bind to .md files (Windows)

In Explorer, right-click any .md → Open With → Choose another app → mdview.cmd (in %APPDATA%\npm\). Tick "Always use this app".

Related

  • msger — Rust/wry host, default backend
  • msgview — Electron host, opt-in backend
  • msgcommon — shared CLI parser and the renderMarkdown helper mdview uses