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

@alwaysmeticulous/recorder-plugin

v2.285.0

Published

Meticulous recorder plugin for Vite, Webpack, Rspack, and Nuxt that injects the recorder script into the HTML head.

Readme

@alwaysmeticulous/recorder-plugin

A bundler plugin that injects the Meticulous recorder script into the <head> of your app's HTML, with one entry point per supported bundler/framework.

By default, the recorder is only injected during development builds — matching Meticulous's recommendation to record real sessions in staging or production via an explicit opt-in.

Built on top of unplugin@3 and tsdown. ESM-only. Requires Node.js 20.19+.

Installing

npm install @alwaysmeticulous/recorder-plugin --save-dev
# or with yarn
yarn add -D @alwaysmeticulous/recorder-plugin
# or with pnpm
pnpm add -D @alwaysmeticulous/recorder-plugin

Usage

// vite.config.ts
import meticulous from "@alwaysmeticulous/recorder-plugin/vite";

export default defineConfig({
  plugins: [
    meticulous({
      recordingToken: "<your-recording-token>",
    }),
  ],
});
// webpack.config.mjs
import meticulous from "@alwaysmeticulous/recorder-plugin/webpack";

export default {
  plugins: [
    meticulous({ recordingToken: "<your-recording-token>" }),
  ],
};

The plugin integrates with html-webpack-plugin when present, and otherwise falls back to rewriting any emitted .html assets.

// rspack.config.mjs
import meticulous from "@alwaysmeticulous/recorder-plugin/rspack";

export default {
  plugins: [
    meticulous({ recordingToken: "<your-recording-token>" }),
  ],
};

For rsbuild, pass the plugin through tools.rspack:

// rsbuild.config.ts
import { defineConfig } from "@rsbuild/core";
import meticulous from "@alwaysmeticulous/recorder-plugin/rspack";

export default defineConfig({
  tools: {
    rspack: {
      plugins: [
        meticulous({ recordingToken: "<your-recording-token>" }),
      ],
    },
  },
});
// nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    [
      "@alwaysmeticulous/recorder-plugin/nuxt",
      { recordingToken: "<your-recording-token>" },
    ],
  ],
});

The Nuxt module injects the recorder script via nuxt.options.app.head.script, which feeds into Nitro's render pipeline and works correctly regardless of which bundler Nuxt is using.

Options

import type { Options } from "@alwaysmeticulous/recorder-plugin";

| Option | Type | Default | Description | | ---------------------- | ---------------------------------------------------------- | -------------------------------------------------- | ----------- | | recordingToken | string (required) | — | Your Meticulous recording token. Emitted as data-recording-token on the injected <script>. | | enabled | "development" \| "always" \| "never" \| (ctx) => boolean | "development" | When to inject. "development" only injects during development builds (Vite command === "serve" or webpack/rspack mode !== "production"). Pass a function for full control. | | inject | "auto" \| "replace" | "auto" | "auto" prepends a new <script> as the first child of <head>. "replace" swaps a placeholder script tag (see below). | | placeholderAttribute | string | "data-meticulous" | Attribute name used to find the placeholder when inject: "replace". | | snippetUrl | string | "https://snippet.meticulous.ai/v1/meticulous.js" | Override the snippet URL. | | attributes | Record<string, string \| boolean \| null \| undefined> | {} | Extra attributes on the <script> tag (e.g. nonce). true emits a boolean attribute; false/null/undefined skip it. Overrides any default attribute, including data-is-production-environment. |

The plugin always emits data-is-production-environment="true" or data-is-production-environment="false" on the injected <script> based on the bundler's detected mode (Vite command === "build" && mode === "production", webpack/rspack mode === "production"). Override it via attributes if you need different behaviour:

meticulous({
  recordingToken: "<your-recording-token>",
  attributes: {
    "data-is-production-environment": process.env.MY_ENV === "prod" ? "true" : "false",
  },
});

Controlling when the recorder loads

meticulous({
  recordingToken: "<your-recording-token>",
  // Always inject — useful in staging.
  enabled: "always",
});

meticulous({
  recordingToken: "<your-recording-token>",
  // Custom predicate.
  enabled: (ctx) => ctx.framework === "vite" && ctx.mode !== "test",
});

The predicate receives an EnabledContext:

interface EnabledContext {
  framework: "vite" | "webpack" | "rspack";
  mode?: string;        // Vite mode / webpack mode / NODE_ENV fallback
  command?: "serve" | "build"; // Vite-only
  isProduction: boolean;
}

Replacing a manually-added placeholder

If you'd rather control where the script lives in your index.html, add a placeholder and switch inject to "replace":

<!-- index.html -->
<head>
  <script data-meticulous></script>
  <!-- ... -->
</head>
meticulous({
  recordingToken: "<your-recording-token>",
  inject: "replace",
  // placeholderAttribute defaults to "data-meticulous"
});

If the placeholder is not found, the plugin falls back to "auto" injection and emits a build warning.