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

ratter-vite

v1.0.1

Published

Vite plugin for seamless ratter integration

Readme

Ratter Vite Plugin

Ratter dashboard

@ratter/vite is the Vite integration for the Ratter stack. It registers the current dev server with the Ratter engine so the local domain, port, and reverse-proxy route stay in sync while you develop.

This package depends on the Ratter engine, which is the backend service that exposes the domain management API at http://localhost:4321 by default.

What It Does

When your Vite dev server starts, the plugin:

  • detects the bound development port
  • resolves a domain name for the project
  • creates or updates a domain in the Ratter engine
  • optionally removes or disables the domain when the server shuts down
  • prints a friendly local URL in the terminal

How It Works

The plugin talks to the engine over HTTP and uses the /api/domains endpoint to synchronize state.

Vite dev server
  -> @ratter/vite plugin
  -> Ratter engine API
  -> Technitium DNS + Caddy
  -> browser-friendly local domain

By default it uses:

  • API URL: http://localhost:4321
  • TLD: localhost
  • target IP: 127.0.0.1

Installation

Install the package in a Vite project:

npm install -D @ratter/vite

You also need a running Ratter engine before the plugin can register anything.

Basic Usage

Add the plugin to your Vite config:

import { defineConfig } from 'vite';
import { ratter } from '@ratter/vite';

export default defineConfig({
  plugins: [
    ratter({
      domain: 'my-app',
      tld: 'com',
    }),
  ],
});

If domain is omitted, the plugin derives a name from the current package name.

Options

| Option | Type | Default | Purpose | | --- | --- | --- | --- | | domain | string | derived from package name | Domain label or full domain to register | | tld | string | localhost | Suffix added when domain is only a label | | type | subdomain | custom | wildcard | subdomain | Domain type sent to the engine | | targetIp | string | 127.0.0.1 | Target IP stored in the engine | | port | number | auto-detected | Port to register for the dev server | | apiUrl | string | http://localhost:4321 | Ratter engine base URL | | deleteOnExit | boolean | false | Delete the domain when Vite shuts down | | verbose | boolean | false | Print extra warnings on failures |

Example Scenarios

Register the current package name

plugins: [ratter()]

Use a custom local domain

plugins: [
  ratter({
    domain: 'dashboard.local',
    apiUrl: 'http://localhost:4321',
  }),
]

Clean up the domain when the dev server closes

plugins: [
  ratter({
    domain: 'admin.local',
    deleteOnExit: true,
  }),
]

Runtime Behavior

The plugin is intentionally lightweight and only applies during development.

  • It uses apply: 'serve', so production builds are not affected.
  • It only runs once the Vite HTTP server is listening.
  • It queries the engine before creating a new domain, so repeated runs update the existing record instead of duplicating it.
  • It deactivates or deletes the domain on shutdown depending on deleteOnExit.

Requirements

  • Vite 4 or newer
  • A running Ratter engine