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-plugin-performance

v2.0.7

Published

vite-plugin-performance tools and runtime components for modern WeChat and multi-platform mini-program development.

Readme

vite-plugin-performance

中文文档

vite-plugin-performance wraps one or more Vite plugins and measures how long each lifecycle hook takes. It keeps the original behaviour intact while giving you actionable performance insights.

✨ Features

  • Wrap a single plugin or an array of plugins with one call
  • Ship with a sensible default hook list, or use hooks: 'all' to cover every function hook
  • Threshold-based reporting so you only see the hooks that really hurt
  • Pluggable logger, formatter, and lifecycle callback for easy monitoring integration
  • Works with asynchronous hooks and still handles errors gracefully

📦 Installation

pnpm add -D vite-plugin-performance
# or npm / yarn / bun

🚀 Quick Start

import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import { wrapPlugin } from 'vite-plugin-performance'

export default defineConfig({
  plugins: [
    wrapPlugin(Inspect(), {
      threshold: 50,
      onHookExecution({ pluginName, hookName, duration }) {
        reportToAPM({ pluginName, hookName, duration })
      },
    }),
  ],
})

Whenever a hook crosses the threshold (default 0 ms) you will see output similar to:

[inspect] transform            ⏱   78.42 ms

⚙️ Options

| Option | Type | Default | Description | | ----------------- | ---------------------------- | --------------------------------- | ------------------------------------------------------------------------- | | hooks | PluginHookName[] \| 'all' | DEFAULT_PLUGIN_HOOKS | Choose which hooks to wrap; pass 'all' to wrap every function hook | | threshold | number | 0 | Only hooks with a duration greater or equal to the threshold are reported | | silent | boolean | false | Disable the built-in logger | | logger | (message, context) => void | console.log | Custom log writer | | formatter | (context) => string | [plugin] transform ⏱ 12.34 ms | Custom message formatter | | onHookExecution | (context) => void | undefined | Callback invoked after a hook finishes | | clock | () => number | performance.now or Date.now | High-resolution timer, handy for tests |

The legacy misspelled option slient is still recognised and mapped to silent.

Default Hook List

import { DEFAULT_PLUGIN_HOOKS } from 'vite-plugin-performance'
// [
//   'options',
//   'config',
//   'configResolved',
//   'configureServer',
//   'buildStart',
//   'resolveId',
//   'load',
//   'transform',
//   'buildEnd',
//   'generateBundle',
//   'renderChunk',
//   'writeBundle',
// ]

🧠 Advanced Usage

Wrap Multiple Plugins

const pluginA = ...
const pluginB = ...

export default defineConfig({
  plugins: wrapPlugin([pluginA, pluginB], { threshold: 20 }),
})

Custom Log Format

wrapPlugin(plugin, {
  formatter({ pluginName, hookName, duration }) {
    return `${pluginName}:${hookName} took ${duration}ms`
  },
  logger(message) {
    myLogger.info(message)
  },
})

Limit to Specific Hooks

wrapPlugin(plugin, {
  hooks: ['resolveId', 'load', 'transform'],
})

🧪 Testing

pnpm --filter vite-plugin-performance test

📄 License

MIT