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

fieldlog

v0.15.1

Published

Fieldlog — write anywhere, resolve later. Offline-first append-log + SQLite read-model + sync.

Readme

fieldlog — Fieldlog

Write anywhere, resolve later.

Offline-first event log for apps that keep writing through outages and sync later: append-only log (source of truth) + SQLite read-model + sync-later. Works for game events, file versions, telemetry samples — a ledger entry (below) is one domain, not the whole story.

import { createKernel } from 'fieldlog';

const k = await createKernel({ file: 'ledger.db' });
await k.append({ type: 'entry', value: 5000, actor: 'device-01' });
const rows = await k.query('SELECT SUM(value) AS total FROM entries WHERE voided = 0');
console.log(rows[0].total); // 5000 — RECORDED, not resolved
k.close();

Any event shape is stored and synced — game kills, file versions, telemetry samples ride the same log:

import { createKernel } from 'fieldlog';

const k = await createKernel({ file: 'app.db' });
await k.append({ type: 'kill', killer: 'player-1', victim: 'boss-3' });
await k.append({ type: 'version', file: 'notes.txt', rev: 3 });
await k.append({ type: 'sample', sensor: 'temp-1', celsius: 21.5 });
k.close();

Offline writes are stored as DRAFT/RECORDED (pre-resolved); sync/ack happens when online. append/query/undo never touch the network — only sync does. Any event shape is stored and synced; the read-model projects entry / tally / undo into queryable tables.

Getting started

  • quickstart — 1 device offline, 2 devices syncing (dev + signed mode), runnable
  • cli — serve / sync / demo, every flag verified against bin/fieldlog.ts
  • Two demos, one regime each, no surviving state: bun run demo (demo/two-node.ts, unsigned dev, fixed port 8091) vs bun bin/fieldlog.ts demo (bin/fieldlog.ts:cmdDemo, signed, ephemeral port). Either proves 20-entry totals then exits; neither graduates to the other (unsigned rows carry no signatures). Real ledger example: example/ledger.mjs (bun example/ledger.mjs)
  • Single writer, one process per file: the kernel mutex is cooperative in-process only (src/kernel.ts:145-156). Details: kernel-api, limits-troubleshooting.

Gallery

| | | |---|---| | hash chain — every append seals to the previous entry | delta sync — only the diff flies, resuming from the last ack | | relay — offline devices exchange messages via the server | snapshot+truncate — trim the log without losing the trail | | capability+revoke — signed tokens, ruthless revocation | quarantine — corrupt entries jailed, never silently dropped | | read model — SQLite rebuilt from the log | soft delete — delete = tombstone, history stays intact |

Concepts & architecture

  • architecture — module map: log/store/kernel/sync/relay/cas/retain
  • contracts — binding promises: dead-letter, blind compensators, seal<=ack, device.explicit, incremental purge, deterministic jitter, v0.5 superset
  • kernel-api — createKernel, Kernel, LogEvent, EventStore
  • sync-protocol — push/pull, failover, backoff, deltasync
  • relay — WsRelayServer + WsRelayClient
  • retention — snapshot + truncate
  • auth — device key, grant, capability token, countersign, revoke

Subsystems (details)

Numbers, limits, contributing

CLI serve/sync default to signed mode: serve needs --trust <id=pub.pem> (repeat per device), sync needs --key <priv.pem> --as <device>. --unsigned open relay is for local dev only, not production.