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

@lodd/node

v0.2.1

Published

Server-side tracking SDK for Lodd — API, agent, MCP, and CLI events

Downloads

395

Readme

@lodd/node

Server-side tracking SDK for Lodd. Built for API, MCP, agent, and CLI products — the headless stuff nothing else tracks well.

Install

npm install @lodd/node

Quick start

import { Lodd } from "@lodd/node";

const ca = new Lodd({
  apiKey: process.env.LODD_API_KEY!,   // ca_... from your Lodd dashboard
  siteId: process.env.CA_SITE_ID!,   // UUID of the site to report to
});

ca.track("api_call", { endpoint: "/v1/search", duration_ms: 42 });

// On graceful shutdown
await ca.close();

Express middleware

import express from "express";
import { Lodd } from "@lodd/node";
import { caExpress } from "@lodd/node/express";

const app = express();
const ca = new Lodd({ apiKey, siteId });

app.use(caExpress(ca, {
  ignore: (req) => req.path === "/health",
}));

The middleware captures path, method, status, and duration_ms. It never captures query strings, request bodies, or headers.

Options

| Option | Default | Notes | |---|---|---| | apiKey | — | Required. | | siteId | — | Required. Overridable per track() call. | | baseUrl | https://api.lodd.dev | Production proxy. Override to point at a local Supabase stack (e.g. http://127.0.0.1:54321) or an alternate deploy. | | maxBatchSize | 50 | Events queued before forced flush. | | flushIntervalMs | 5000 | Timer-based flush cadence. | | onError | console.warn | Called for dropped events or failed batches. |

Guarantees

  • track() never throws.
  • Events >8KB of properties are dropped (with onError).
  • Failed batches are retried up to 3× with exponential backoff; then dropped.
  • close() flushes any queued events.

Session granularity

Server-side events don't have natural session boundaries, so the SDK synthesises a session_id deterministically from user_id + site_id + UTC date. This makes Daily Active Users correct out of the box, but a single user active across multiple UTC days will count as multiple unique_visitors in weekly/monthly range aggregations. Supply your own session_id in a future ca.track() overload if you need different granularity.