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

@sometic/activity

v0.2.3

Published

Portable activity/audit log state for Sometic.

Readme

@sometic/activity

Activity and audit feed state for Sometic: append entries, filter by actor, resource, type, and time range, then page forward with stable cursors.

createActivityController keeps an append only log. Entries are returned newest first, and entries that share a timestamp keep their insertion order, so a burst of writes in the same millisecond never shuffles on re-read. Backdated entries sort by their own createdAt, which makes backfilled history behave correctly.

Why it exists: an audit trail looks trivial until you need cursor pagination that survives new inserts, filters that compose, and copies that callers cannot mutate. This package owns that state so every framework renders the same feed.

Depends on @sometic/core only. No browser globals at import time, so it is safe in SSR, workers, and Node.

Docs: introduction and https://sometic.dev.

Install

pnpm add @sometic/activity
npm install @sometic/activity
yarn add @sometic/activity

Usage

import { createActivityController } from "@sometic/activity";

const activity = createActivityController({ pageSize: 25, maxEntries: 500 });

activity.append({
    type: "invoice.updated",
    message: "Changed the invoice total",
    actorId: "user-1",
    resourceId: "invoice-42",
    meta: { field: "total" },
});

const page = activity.getPage({ filter: { resourceId: "invoice-42" } });
const next = activity.getPage({ cursor: page.nextCursor });

Subscribe to changes and clean up:

const stop = activity.subscribe((entries) => render(entries));

stop();
activity.dispose();

API

  • createActivityController({ entries?, pageSize?, maxEntries?, now?, onChange? }).
  • append(input) and appendMany(inputs) commit once and return normalized entries. Optional fields become null, and meta is copied so later edits to your object cannot reach the log.
  • getEntries(filter?), getEntry(id), count(filter?).
  • getPage({ cursor?, limit?, filter? }) returns { items, nextCursor, hasMore }. An unknown cursor throws a typed error with code activity_invalid_cursor instead of silently returning page one.
  • clear(), subscribe(listener), dispose(), disposed.
  • Filters accept type, types, actorId, resourceId, since, and until.

Writes after dispose() throw activity_disposed, which surfaces leaked controllers in tests rather than letting them accumulate entries nobody reads.

When not to use

Skip it when the feed is a plain server rendered list with no client filtering or paging. Prefer a real audit service when you need tamper evidence, retention policies, or compliance exports. This package holds the client side view of a log; it does not persist anything.

Docs

License

MIT