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

@marianmeres/tracker

v1.1.2

Published

[![JSR](https://jsr.io/badges/@marianmeres/tracker)](https://jsr.io/@marianmeres/tracker) [![NPM](https://img.shields.io/npm/v/@marianmeres/tracker)](https://www.npmjs.com/package/@marianmeres/tracker) [![License](https://img.shields.io/npm/l/@marianmeres

Readme

@marianmeres/tracker

JSR NPM License

A small, framework-agnostic client for emitting application events (user/session/UI signals) and forwarding them to a transport in batches.

Built on top of @marianmeres/batch. The package is vanilla — no Svelte/React glue, no automatic page-view tracking, no schema validation. Consumers wire those in if they want them.

Installation

deno add jsr:@marianmeres/tracker
# or
npm install @marianmeres/tracker

Usage

import { Tracker, attachUnloadFlush } from "@marianmeres/tracker";

type Events = {
    "chat.mode.toggle": { from: "voice" | "text"; to: "voice" | "text" };
    "quiz.skip":        { moduleId: string; questionId?: string };
    "menu.enter":       { item: string } | undefined;
};

const tracker = new Tracker<Events>({
    transport: async (events) => {
        await fetch("/api/events", {
            method: "POST",
            body: JSON.stringify({ events }),
        });
    },
    flushIntervalMs: 1000,
    flushThreshold: 50,
    context: { appVersion: "1.2.3" },
});

tracker.identify("user-123", { plan: "pro" });
tracker.track("chat.mode.toggle", { from: "voice", to: "text" });
tracker.track("quiz.skip", { moduleId: "m1" });
tracker.track("menu.enter"); // payload optional because the type includes `undefined`

// Browser only: flush queued events on tab close.
attachUnloadFlush(tracker, { beaconUrl: "/api/events/beacon" });

Features

  • Type-safe event map — declare a TEventMap and track() autocompletes event names + enforces payload shape. Without a map the API stays permissive.
  • Batching — interval + threshold-based, with a hard maxBatchSize cap.
  • Transport contracttrue consumed, false dropped, throw to requeue at head. No built-in retry/backoff (layer it inside your transport).
  • Enrichers + middleware — synchronous transformers / drop hooks for PII scrubbing, allow-lists, consent gates, etc.
  • Identify / reset / setContext — userId, traits, and super-properties stamped onto every event at track() time.
  • Pause / resume — useful during opt-out flows; queued events survive.
  • Reactive subscription — Svelte-store-shaped subscribe(state => ...).
  • Browser unload helper — opt-in attachUnloadFlush() flushes via navigator.sendBeacon (when beaconUrl is provided) or falls back to a best-effort drain() on pagehide / visibilitychange:hidden.

API

See API.md for the complete API reference.

License

MIT