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

peekmd

v1.1.0

Published

Quick markdown file previewer that looks like your GitHub README. Requires Bun.

Downloads

488

Readme

peekmd

npm version npm downloads GitHub release License: MIT

A CLI tool to preview markdown files with GitHub-style rendering in your browser.

Features

  • GitHub Flavored Markdown (GFM) rendering
  • Syntax highlighting for code blocks
  • GitHub-style alerts ([!NOTE], [!TIP], [!WARNING], [!IMPORTANT], [!CAUTION])
  • Task lists with checkboxes
  • Anchor links on headings
  • File tree sidebar
  • Opens in your default browser automatically
  • Auto-closes when you close the browser tab
  • Cross-platform: macOS, Linux, Windows

Requirements

Bun is required to run peekmd. Install it with:

curl -fsSL https://bun.sh/install | bash

Installation

Quick Run (no install)

# Using bunx (recommended)
bunx peekmd README.md

# Using npx (requires Bun in PATH)
npx peekmd README.md

Global Installation

# Using bun (recommended)
bun install -g peekmd

# Using npm (requires Bun in PATH)
npm install -g peekmd

Then run from anywhere:

peekmd README.md

Manual Installation (from source)

Clone the repository and choose one of the following approaches:

git clone https://github.com/HelgeSverre/peekmd.git
cd peekmd
bun install

Option A: Link for Development

This creates a symlink so you can run peekmd from anywhere. Requires Bun to be in your PATH.

bun link

Now you can run:

peekmd /path/to/file.md

To unlink later:

bun unlink peekmd

Option B: Build Standalone Binary

This creates a self-contained executable that works without Bun installed at runtime.

bun run compile

This creates a peekmd binary in the project directory. Move it to your PATH:

# macOS/Linux
sudo mv peekmd /usr/local/bin/

# Or add to your local bin
mv peekmd ~/.local/bin/

Usage

# Preview a README file
peekmd README.md

# Preview any markdown file
peekmd docs/guide.md

# Preview with full path
peekmd /path/to/file.md

Controls

  • Press ESC to close the preview
  • Close the browser tab to exit

What it does

peekmd renders your markdown files with a GitHub-style interface by:

  1. Reading the markdown file specified in the CLI argument
  2. Extracting metadata:
    • Description: Finds the first paragraph after any heading (filters out headings, lists, and code blocks)
    • Topics: Generates placeholder tags based on the repository name (currently hardcoded: "markdown", "preview", "documentation")
    • Repository stats: Placeholder values for stars (0), watchers (1), and forks (0)
  3. Generating a file tree: Creates a directory tree view of the current working directory (up to 3 levels deep, max 20 items per level)
  4. Rendering the markdown: Converts markdown to HTML with:
    • GitHub Flavored Markdown (GFM) support
    • Syntax highlighting for code blocks
    • GitHub-style alerts ([!NOTE], [!TIP], etc.)
    • Task lists with checkboxes
    • Anchor links on headings
  5. Replacing template placeholders:
    • {{filename}} - The markdown filename
    • {{repoName}} - The parent directory name
    • {{dirPath}} - The relative directory path
    • {{content}} - The rendered markdown HTML
    • {{fileTree}} - The directory tree structure
    • {{description}} - The extracted description
    • {{topics}} - The generated topic tags
    • {{stars}}, {{watchers}}, {{forks}} - Repository stats
  6. Starting a local server on port 3456 and opening the preview in your default browser

Development

# Run in development mode
bun run dev

# Format code
bun run format

# Build standalone binary
bun run compile

Why Bun?

peekmd uses Bun's built-in HTTP server (Bun.serve()) for its simplicity and performance. This means:

  • Zero configuration HTTP server
  • Native TypeScript execution
  • Fast startup time
  • Small package size (ships TypeScript source, no build step needed)

Troubleshooting

"bun: command not found"

Bun is not installed or not in your PATH. Install it:

curl -fsSL https://bun.sh/install | bash

Then restart your terminal or run:

source ~/.bashrc  # or ~/.zshrc

"ReferenceError: Bun is not defined"

You're running with Node.js instead of Bun. This can happen if:

  • You installed an older version of peekmd
  • The shebang is incorrect

Update to the latest version:

bun install -g peekmd@latest

Or if running from source, make sure cli.ts has #!/usr/bin/env bun as the first line.

License

MIT