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

@qlub-foss/argus

v1.5.0

Published

Web performance metric collector

Downloads

162

Readme

Argus — Web performance metric collector

npm version

Argus, named after the many-eyed giant in Greek mythology, watches your client-side app and emits structured performance payloads you can forward to analytics or logging.

  • Web Vitals — CLS, INP, LCP, FCP, and TTFB via web-vitals
  • API timingPerformanceObserver on resource entries, filtered by URL regex and optional duration bounds
  • User timingperformance.mark / measure flows with optional duration bounds, using helpers that pair with named trackers

Installation

The package is published under the npm organization qlub-foss (scope @qlub-foss). Install with your preferred package manager:

npm install @qlub-foss/argus
yarn add @qlub-foss/argus
pnpm add @qlub-foss/argus
bun add @qlub-foss/argus

Published on the public npm registry. No custom .npmrc is required for installation.

Configuration

Define an ArgusConfig (partial configs are merged with defaults):

  • samplingRate — Global default (0–1) when a subsection does not override it.
  • webVitalsenabled, samplingRate, optional whitelistedFields on the emitted payload.
  • apiTimingenabled, samplingRate, trackers (regex, optional label, lowerBound, upperBound, per-tracker samplingRate), optional whitelistedFields.
  • userTimingenabled (default off in defaults), samplingRate, trackers (id matching your mark/measure names, optional bounds and samplingRate), optional whitelistedFields.

Each reported object is normalized with agent: "argus", timing fields, your init metadata, and an event / argusMetricType derived from the collector (web-vital, api-timing, user-timing).

Example config

import type { ArgusConfig } from '@qlub-foss/argus';

export const argusConfig: ArgusConfig = {
  samplingRate: 1,
  webVitals: {
    enabled: true,
    samplingRate: 1,
  },
  apiTiming: {
    enabled: true,
    samplingRate: 1,
    trackers: [
      {
        regex: /\/gods/,
        label: 'fetch_greek_gods',
        lowerBound: 200,
        upperBound: 800,
        samplingRate: 0.7,
      },
      {
        regex: /\/philosophers/,
        label: 'fetch_philosophers',
        lowerBound: 100,
        upperBound: 900,
        samplingRate: 0.3,
      },
    ],
  },
  userTiming: {
    enabled: true,
    samplingRate: 1,
    trackers: [{ id: 'checkout-flow', lowerBound: 0, upperBound: 30_000 }],
  },
};

Usage

  1. Provide a report callback (send to your backend, analytics, or logger).
  2. Call Argus.getInstance(onReport, config) once — the class is a singleton; the first call’s config is kept for the lifetime of the page.
  3. Call init(metadata?) with optional key/value metadata merged into each payload.
  4. On teardown (e.g. React useEffect cleanup), call shutdown() to disconnect observers.

User timing trackers expect you to bracket work with the exported helpers (or equivalent marks/measures). The id in config must match the prefix used in markUserTimingStart / markUserTimingEnd:

import { useEffect } from 'react';
import { Argus, markUserTimingStart, markUserTimingEnd } from '@qlub-foss/argus';
import { argusConfig } from './argusConfig';

const handleMetricReport = (metric: Record<string, any>) => {
  // forward metric
};

export function App() {
  useEffect(() => {
    const argus = Argus.getInstance(handleMetricReport, argusConfig);

    void argus.init({
      appVersion: '1.0.0',
    });

    return () => {
      argus.shutdown();
    };
  }, []);

  const onCheckout = () => {
    markUserTimingStart('checkout-flow');
    try {
      // ...
    } finally {
      markUserTimingEnd('checkout-flow');
    }
  };

  // ...
}

The same pattern works in other frameworks: instantiate once, init after mount, shutdown on unmount. The library targets browsers with PerformanceObserver and the Web Vitals APIs.

Development

  • Install pnpm (version pinned in package.json as packageManager).
  • Install dependencies: pnpm install
  • Build: pnpm build
  • Test: pnpm test

Hooks and quality tooling: Lefthook, ESLint, Prettier, and Commitlint (conventional commits). See Conventional Commits for message format.

Releases

CI runs tests and build, then semantic-release on pushes to main, alpha, beta, and gamma (see .github/workflows/semantic-release.yml). Releases are published to npm and GitHub Releases; version bumps and changelog updates follow Conventional Commits.

License

MIT