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

vite-refresh-zen

v0.2.2

Published

Pause and resume Vite HMR - batch file changes and apply them all at once

Readme

vite-refresh-zen

Pause and resume Vite HMR. Batch file changes and apply them all at once with a single reload.

Perfect for when AI tools (like Claude Code) are editing multiple files rapidly and you don't want the browser going crazy with constant refreshes.

Quick Start

bunx refresh-zen

This interactive installer will:

  1. Ask for your dev server URL
  2. Configure Claude Code hooks (.claude/settings.json)
  3. Add the plugin to your vite.config.ts

Non-interactive

bunx refresh-zen -y                              # Accept all defaults
bunx refresh-zen -y --url=https://app.localhost  # Custom URL

Manual Install

bun add -D vite-refresh-zen

Usage

// vite.config.ts
import { defineConfig } from 'vite';
import { refreshZen } from 'vite-refresh-zen';

export default defineConfig({
  plugins: [
    refreshZen(),
  ],
});

Control Endpoints

When Vite dev server is running, these endpoints are available:

| Endpoint | Description | |----------|-------------| | /__zen/pause | Pause HMR - file changes will be buffered | | /__zen/resume | Apply all pending changes (triggers full reload) | | /__zen/status | Get current state and pending files | | /__zen/discard | Discard pending changes without applying | | /__zen/toggle | Toggle pause state |

Example

# Pause before Claude starts working
curl http://localhost:5173/__zen/pause

# Claude edits 20 files...

# Apply all changes at once
curl http://localhost:5173/__zen/resume

Options

refreshZen({
  // Base path for control endpoints (default: '/__zen')
  basePath: '/__zen',

  // Log state changes to console (default: true)
  log: true,

  // Auto-resume after N ms of no file changes (default: 0 = disabled)
  autoResumeMs: 0,
});

Auto-resume

If you set autoResumeMs, the plugin will automatically resume and apply changes after that many milliseconds of no file activity. This is useful if you want "debounced" HMR:

refreshZen({
  autoResumeMs: 2000, // Resume 2s after last file change
});

Claude Code Integration

Add hooks to auto-pause when Claude starts editing, and auto-resume when Claude finishes:

// .claude/settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "curl -sk ${VITE_ZEN_URL:-http://localhost:5173}/__zen/pause > /dev/null"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "curl -sk ${VITE_ZEN_URL:-http://localhost:5173}/__zen/resume > /dev/null"
          }
        ]
      }
    ]
  }
}
  • PreToolUse on Edit/Write → pauses HMR before any file change
  • Stop → resumes and applies all changes when Claude finishes responding

Fully automatic - no manual intervention needed.

Custom URL (portless, etc.)

By default, hooks hit http://localhost:5173. To use a different URL (e.g., with portless):

# In your shell profile or .env
export VITE_ZEN_URL=https://myapp.localhost

License

MIT