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-dev-modified-highlight

v0.1.0

Published

Vite dev-only plugin: injects source file mtime on exported React components + optional UI to highlight recently edited files.

Readme

vite-dev-modified-highlight

Önálló npm-csomag: a demo/ app nem része — csak fejlesztéshez használhatod külön repóban / mappában. A publikált .tgz tartalmát a package.json files mező szűri (dist, README, LICENSE); forráskód és demo nem kerül az npmre.


Vite dev-only plugin + opcionális React UI: a **/src/**/*.tsx fájlokban exportált komponensek JSX-gyökerére injektálja a forrásfájl mtime-ját (data-source-mtime-ms). A dev overlay frissen szerkesztett nézeteket piros kerettel emeli ki.

Miért csak dev?

  • A plugin apply: "serve" → csak vite / vite dev fut, vite build nem módosít kódot (nincs felesleges attr a production bundle-ben).
  • A React komponens import.meta.env.DEV ellenőrzés → productionben semmit nem renderel.

Telepítés

npm install -D vite-dev-modified-highlight

Csak devDependency kell — éles build nem függ tőle.

Beüzemelés (lépésről lépésre)

  1. Telepítés (fent): npm install -D vite-dev-modified-highlight.
  2. Vite pluginvite.config.ts-ben a React plugin elé tedd (a csomag enforce: "pre", így általában jó sorrend: először ez, aztán @vitejs/plugin-react).
  3. CSS egyszer — a belépő fájlban (pl. main.tsx) kötelező:
    import "vite-dev-modified-highlight/style.css"
    Enélkül nincs körvonal / sarok gomb stílus.
  4. React UI (opcionális, de ajánlott) — pl. az App JSX végén:
    import { ModifiedHighlightControl } from "vite-dev-modified-highlight/react"<ModifiedHighlightControl />.
  5. Dev szervernpm run dev. A kiemelés és az mtime injektálás csak itt működik (vite build / preview nem kapja a plugin transformot).
  6. Váltás — sarokban „Piros keret”, vagy Alt+Shift+M. Állapot: localStorage kulcs vite-dev-modified-highlight:enabled.

Minimal példa

vite.config.ts

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { sourceMtimePlugin } from "vite-dev-modified-highlight";

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

main.tsx (vagy ahol a React fa indul)

import "vite-dev-modified-highlight/style.css";
// … többi import …

App.tsx

import { ModifiedHighlightControl } from "vite-dev-modified-highlight/react";

export default function App() {
  return (
    <>
      {/* saját tartalom */}
      <ModifiedHighlightControl />
    </>
  );
}

Vite (részletek)

A React plugint tartsd előtte (enforce: "pre" a csomagon belül), ha más transform is érinti a TSX-et.

React UI (részletek)

Fontos: a CSS-t külön importáld egyszer — a komponens nem tölti be automatikusan (így a bundler biztosan lássa a stílust).

Közzététel npm-en

cd vite-dev-modified-highlight
npm install
npm run build
npm publish --access public

Scoped névhez állítsd a package.json name mezőt (pl. @szervezet/vite-dev-modified-highlight).

Korlátok

  • Csak .tsx fájlok a projekt src útvonal alatt (ugyanaz a szűrés, mint a referencia implementációban).
  • Exportált komponensfüggvény JSX return-jére dolgozik.