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

hmr-serve

v0.1.3

Published

Point at any folder and review it live in the browser — VSCode-style file tree + content pane, powered by Vite's dev server and HMR client.

Readme

hmr-serve

Point hmr-serve at any folder and review it live in the browser: a VSCode-style file tree on the left, a content pane on the right, and instant updates as files change on disk — powered by Vite's real dev server and HMR client, not a hand-rolled watcher/websocket.

HMR (Hot Module Replacement) is the mechanism that pushes file changes into the browser over a WebSocket so the page updates without a full refresh. This project uses Vite's HMR rather than inventing its own.

Tip: Helpful for reviewing AI agent output (markdown/HTML docs) as it iterates.

Quickstart

npx hmr-serve ./some-folder
# → opens http://localhost:5183 with a live tree + content pane

Or run it like serve without the nav — serves directory listing or index.html if present, plus rendered Markdown, CSV/TSV, all with HMR:

npx hmr-serve ./some-folder --no-nav

For a permanent setup, install globally and use the short hmr command:

npm install -g hmr-serve
hmr ./some-folder
hmr ./some-folder --no-nav

CLI:

hmr [dir]              Folder to serve (default: current directory)
  --port <port>        Port to listen on (default: 5183)
  --open               Open the browser on start
  --no-nav             Like serve, without the tree UI

Default (nav) mode shows a VS Code-style file tree and content pane. Supported types: Markdown (rendered), HTML (sandboxed iframe), code (.css, .js, .ts, .json, … syntax-highlighted), text, CSV/TSV (tables), images, and video. A gear menu toggles which categories show in the tree, plus an Other files option. Choices are remembered per folder (localStorage).

--no-nav skips the tree UI: if the folder has index.html (or index.htm), that is the root page; otherwise you get a directory listing. Markdown, CSV, and TSV are still rendered to HTML, and edits hot-reload via Vite.

Architecture

  1. No build step for your content. Runs in Vite dev-server mode only. The app shell (a tiny Vue UI) is Vite's root; your folder is mounted alongside it via middleware + server.fs.allow. Your files are the content — nothing is compiled.
  2. Live search index. Built at startup with MiniSearch (no native deps) and kept current incrementally off file-watch events — no rebuild step.
  3. Plain HTTP + WebSocket, cross-browser. The browser only talks to the Node server over HTTP and Vite's HMR socket. No File System Access API, no Chromium-only APIs — works in Safari and Firefox.
  4. Extensible renderer registry. .mdmarkdown-it; .html → sandboxed iframe; .css/.txt → server-side highlight.js; .csv/.tsv → HTML tables styled with GitHub markdown CSS. New types register in src/server/renderers/ without touching routing.
  5. Lightweight CLI via cac: <path>, --port, --open, --no-nav.

Live content updates ride Vite's HMR channel: the server pushes a custom hmr-serve:update event and the content pane re-fetches — so Vite's client handles transport and reconnection for us.

Links & URLs. Raw HTML is served at mirror paths (/__hmrserve/raw/<file>), so relative links and assets inside a framed doc (href="contact.html", <img src="logo.png">) resolve against the real folder layout. The selected file is reflected in a clean, bookmarkable URL under the served folder's name — e.g. serving ./aurora-notes gives /aurora-notes/docs/intro.md. These are real History-API paths (no #): shareable, reload-safe, and back/forward works. Unknown paths 404 rather than rendering the app, so a stray absolute link can't nest the shell inside the content pane.

src/
  cli/       arg parsing + entry
  server/    Vite plugin, middleware, search index, watcher, renderers
  client/    Vue app shell (tree + content pane)
  shared/    types shared across server and client
fixtures/    versioned sample files used by tests
tests/       unit · component · e2e

Contributing

See CONTRIBUTING.md for local setup and test expectations.

License

MIT