
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-plugin-fps-meter
Advanced tools
vite-plugin-fps-meter is a tiny Vite plugin that overlays a live FPS / ms badge (with p95/p99 and Long Task %) on your app. It can auto-inject in dev or build, toggles via URL/localStorage, adapts to Vite's error overlay, and exposes a simple runtime API.
vite-plugin-fps-meter is a tiny Vite plugin that overlays a live FPS / ms badge (with p95/p99 and Long Task %) on your app. It can auto-inject in dev or build, toggles via URL/localStorage, adapts to Vite's error overlay, and exposes a simple runtime API.
➠ Install
# yarn
yarn add -D vite-plugin-fps-meter
# pnpm
pnpm add -D vite-plugin-fps-meter
# npm
npm i -D vite-plugin-fps-meter
➠ Quick Start
// vite.config.ts
import { defineConfig } from 'vite';
import fpsMeter from 'vite-plugin-fps-meter';
export default defineConfig({
plugins: [
fpsMeter({
// Show badge only in dev by default ("dev" | "build" | boolean)
enabled: 'dev',
// Optional fine-tuning (defaults shown below in Options)
position: 'tl',
maxDisplayFps: 240,
}),
],
});
➠ How it looks / Works
➠ Options
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | 'dev' | 'build' | 'dev' | Controls when the runtime is injected and started. 'dev' = Vite serve, 'build' = during build preview/runtime, true/false to force on/off. |
updateIntervalMs | number | 250 | UI update interval (ms). |
smoothingTauMs | number | 300 | EMA smoothing time constant (ms). |
skipFrameThresholdMs | number | 400 | Skip frames with dt above this threshold (e.g., tab switches) to avoid skewing EMA. |
pauseOnHidden | boolean | true | Pause meter when document.hidden is true. |
maxDisplayFps | number | 240 | Cap displayed FPS. |
position | 'tl' | 'tr' | 'bl' | 'br' | 'tl' | Badge position: top/bottom & left/right. |
zIndex | number | 2147483647 | CSS z-index of the badge. |
storageKey | string | 'vite:fps-meter' | LocalStorage key for persisted toggle. |
showInIframe | boolean | true | If false, the meter won't render inside iframes. |
percentileWindowSize | number | 300 | Number of recent frame durations used to compute p95/p99. |
➠ Runtime controls
?fps=1 to force-enable, ?fps=0 to force-disable on first load.localStorage['vite:fps-meter'] (customizable via storageKey).// Toggle at runtime
window.__fpsMeter?.setEnabled(false);
window.__fpsMeter?.setEnabled(true);
// Read current state
const on = window.__fpsMeter?.isEnabled();
➠ Programmatic init (advanced)
By default, the plugin auto-injects and auto-starts. If you need a custom instance, you can import the virtual client and mount manually:
// Somewhere in your app (advanced usage)
import initFpsMeter from 'virtual:fps-meter-client';
const dispose = initFpsMeter({ position: 'br' });
// ...later
dispose();
Note: manual init will create another badge in addition to the auto-injected one. Prefer the global API above unless you have a specific reason to manage instances yourself.
➠ Notes on metrics
p95/p99 are computed over a small sliding window of recent frames to avoid heavy allocations.PerformanceObserver with { type: 'longtask', buffered: true }. If unsupported, it's silently disabled.➠ Compatibility
^5 | ^6 | ^7.>=18.showInIframe: false is set.➠ License
MIT
FAQs
vite-plugin-fps-meter is a tiny Vite plugin that overlays a live FPS / ms badge (with p95/p99 and Long Task %) on your app. It can auto-inject in dev or build, toggles via URL/localStorage, adapts to Vite's error overlay, and exposes a simple runtime API.
We found that vite-plugin-fps-meter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.