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

httpmd

v1.0.0

Published

A simple HTTP server for serving static files and previewing Markdown files

Readme

httpmd

npm version license GitHub stars

httpmd is a lightweight, zero-config HTTP server designed to serve static files and instantly preview Markdown files with beautiful syntax highlighting. Whether you're a developer sharing documentation, a writer previewing blog posts, or just need a quick static file server, httpmd has you covered. Run it anywhere, access it from any device on your network, and enjoy a seamless experience!

✨ Features

  • Markdown Preview: Render .md files as styled HTML with syntax highlighting powered by highlight.js.
  • Static File Serving: Serve any file type (HTML, CSS, JS, images, PDFs, etc.) with proper MIME types.
  • Directory Listing: Browse directories with clickable links when no index.html is present (configurable for security).
  • Network Access: Accessible on all network interfaces (e.g., 192.168.1.5), not just localhost.
  • Customizable Port: Choose your preferred port with a simple flag.
  • Security Option: Hide directory listings with -k/--keep to prevent file exposure.
  • Visitor Logging: Track visitor IPs, ports, and requested paths with -l/--look, optionally saving to a log file.
  • Cross-Platform: Runs on Windows, macOS, Linux—anywhere Node.js is installed.
  • No Dependencies Hassle: Only relies on marked and highlight.js, bundled for you.

🚀 Installation

Get started in seconds with npm:

npm install -g httpmd

This installs httpmd globally, making the httpmd command available everywhere.

📚 Usage

Run httpmd in any directory to start serving files and previewing Markdown. It's that simple!

Basic Usage

httpmd
  • Starts the server on port 3000.
  • Access at http://localhost:3000 or your machine's IP (e.g., http://192.168.1.5:3000).
  • Markdown files (.md) are rendered as styled HTML.
  • Other files are served as-is.
  • Directories list files (unless -k is used or index.html exists).

Command-Line Options

Customize your server with these flags:

| Flag | Description | |----------------------|-----------------------------------------------------------------------------| | -h, --help | Show help with usage and examples. | | -v, --version | Display the current version (1.0.0). | | -p, --port <port>| Set a custom port (default: 3000). Example: -p 8080. | | -k, --keep | Hide directory listings for security (returns 404 if no index.html). | | -l, --look [<path>] | Log visitor IP, port, and requested path. Optionally save to visitor.log at <path>. |

Examples

  1. Start a server on default port:

    httpmd
    • Serves files at http://localhost:3000.
    • Lists directory contents if no index.html.
  2. Use a custom port:

    httpmd -p 8080
    • Access at http://localhost:8080 or your IP.
  3. Secure mode (hide directory listing):

    httpmd -k
    • Returns 404 for directories without index.html.
  4. Log visitors to console:

    httpmd -l
    • Outputs: [2025-04-13T09:05:56.299Z 127.0.0.1:2563 /test.md].
  5. Log visitors to a file:

    httpmd -l ./logs
    • Saves logs to ./logs/visitor.log.
  6. Combine options:

    httpmd -p 8080 -k -l ./logs
    • Runs on port 8080, hides listings, logs to ./logs/visitor.log.

🛠️ Quick Start

  1. Create a Markdown file, e.g., test.md:

    # Welcome to httpmd!
    
    This is a **Markdown** file.
    
    `Hello, world!`
  2. Run the server:

    cd your-directory
    httpmd
  3. Open your browser:

    • Visit http://localhost:3000/test.md to see the rendered Markdown.
    • Visit http://<your-ip>:3000 (e.g., http://192.168.1.5:3000) from another device.
    • Browse directories or serve index.html if present.

📦 Why Choose httpmd?

  • Simple: No configuration files needed—just run and go.
  • Flexible: Preview Markdown, serve static sites, or share files across your network.
  • Secure: Optional directory hiding protects sensitive folders.
  • Developer-Friendly: Clean CLI, detailed logging, and MIT-licensed for freedom.
  • Lightweight: Minimal dependencies, fast startup.

🐛 Reporting Issues

Found a bug or have a suggestion? Open an issue at GitHub Issues. We appreciate your feedback!

🤝 Contributing

Want to make httpmd even better? Fork the repo, make your changes, and submit a pull request at GitHub. All contributions are welcome!

📝 License

httpmd is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit.

👨‍💻 Author

Created by Alexander Ezharjan ([email protected]).

Follow the project on GitHub and star it to show your support! ⭐


Happy serving with httpmd! 🚀