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

mdv-cli

v1.0.4

Published

Ultra-lightweight markdown-focused viewer CLI

Readme

mdv

Ultra-lightweight markdown-focused viewer.

Features

  • CLI launch: mdv [path]
  • Opens browser automatically by default
  • File mode and folder mode
  • Folder mode: markdown tree + preview pane
  • GitHub-like markdown style (github-markdown-css)
  • GFM task list rendering (- [ ], - [x])
  • Mermaid diagram rendering from fenced blocks (click to expand fullscreen)
  • Supports relative image/file links under opened root
  • Secure path handling (prevents traversal outside root)

Split View

  • Cmd+click (or right-click → "横に並べて開く") to open a file side-by-side
  • Arrow Left / Right to switch panes, Arrow Up / Down to scroll active pane
  • Exit multiview button to return to single pane

Document Index

  • Floating table-of-contents popup showing h1–h3 headings
  • Click a heading to smooth-scroll to it

Tree & Navigation

  • Sidebar file tree with search/filter
  • Collapsible sidebar toggle
  • Auto-selects README.md as initial file
  • Browser back/forward support via URL hash
  • Relative markdown links navigate within the viewer
  • Anchor links (#heading-id) smooth-scroll within a document
  • External links open in a new tab

UI

  • Scroll-to-top button on long documents
  • Responsive mobile layout (< 900px)
  • Dark code blocks with JetBrains Mono font
  • Striped table rows

Security

  • Content Security Policy (CSP) with nonce
  • X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer
  • Executable files (.html, .js, .svg, etc.) forced to download as attachment
  • Symlink resolution to prevent directory breakout
  • Mermaid is enabled and pulls transitive dependencies; risk assessment is documented in SECURITY.md

Install

npm install -g mdv-cli

After installing globally, mdv and mdv-ghostty are available in your shell.

Usage

# npx (no install required)
npx mdv-cli .
npx mdv-cli README.md

# after global install
mdv
mdv .
mdv README.md
mdv ./docs --port 5000 --host 127.0.0.1
mdv ./docs --no-open
mdv ./docs --open-mode none --print-url

Options

  • --host <host>: bind host (default: 127.0.0.1)
  • --port <number>: start port (default: 43110)
  • --open-mode <browser|none>: browser launch mode (default: browser)
  • --print-url: print a plain URL line after startup
  • --no-open: do not auto-open browser
  • --help: show help

Ghostty + mdv (macOS)

mdv-ghostty starts mdv, opens the preview in your default browser, and then arranges Ghostty + browser side by side.

mdv-ghostty .
mdv-ghostty ./docs

If you installed via npm install -g mdv-cli, mdv-ghostty is also available in your shell.

Ghostty config example

Use Ghostty split for shell workflow while browser stays on the other half:

keybind = cmd+d=new_split:right

Reference: https://ghostty.org/docs/config/keybind

Notes

  • mdv-ghostty currently targets macOS (uses AppleScript).
  • On first run, macOS may ask for Accessibility permission for terminal/osascript.
  • If window arrangement fails, mdv still keeps running and prints the preview URL.
  • --host 0.0.0.0 exposes file access over your network. Use only in trusted environments.

Scope / Constraints

  • Target extensions: .md, .markdown
  • Raw HTML in markdown is disabled (html: false)
  • Mermaid is rendered client-side from ```mermaid blocks
  • Mermaid security level is fixed to strict
  • Excluded directories: .git, node_modules, vendor, vender, dist, build, out, .next, .cache
  • If port is occupied, next available port is used automatically