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

@loomup/offline

v0.1.23

Published

First-party browser SQLite and offline resource client for Loomup

Readme

@loomup/offline

The batteries-included browser SQLite client for Loomup sync v1.

import { createOfflineClient } from "@loomup/offline";

const offline = await createOfflineClient({
  url: "http://127.0.0.1:3000",
  database: "north-gate.sqlite",
  resources: ["attendees", "checkins"],
});

await offline.from("checkins").create({
  id: crypto.randomUUID(),
  attendee_id: "attendee-1",
  entrance_id: "north",
});

offline.subscribe(({ phase, pending }) => {
  console.log(phase, pending);
});

The package owns SQLite/WASM loading, the internal persistence table, IndexedDB file snapshots, connectivity events, realtime invalidation, and SyncStore lifecycle. Use storage to inject another SyncStorage implementation for tests or non-browser runtimes.

Event-driven synchronization

For an application whose offline store owns all realtime data recovery, pass an existing client created with realtimeResync: false and configure:

const offline = await createOfflineClient({
  client,
  resources: ["checkins"],
  pollIntervalMs: 15_000,
  reconcileIntervalMs: 300_000,
  liveDebounceMs: 120,
  autoConnectivity: false, // app verifies cookie identity before resume
});

reconcileIntervalMs applies only while the transport and all required subscriptions are healthy. Otherwise pollIntervalMs applies, with failed-pull backoff up to 60 seconds (or the configured interval if larger). The new healthy interval defaults to pollIntervalMs, preserving existing defaults.

Socket events are batched from the first event, with one sync in flight and at most one queued follow-up. Reconnect recovery pulls the cursor once per cycle, not once per subscribed table or returned row. Pagination may require several HTTP requests within a cycle.

Call setActive(false) while hidden and setActive(true) after authenticating on resume; use setOnline(false) offline. Pausing automatic work preserves socket heartbeats and explicit sync()/mutation behavior. An explicit hidden sync permits one cycle; socket invalidations cannot extend it with hidden follow-ups. Queued automatic cycles also recheck the active state before starting. Close the offline client on logout or teardown. Browser lifecycle ownership is optional; the existing autoConnectivity default remains enabled.

Status includes realtime, dataRevision, and per-table resourceRevisions. Use revisions, not idle-status transitions, to invalidate UI reads. Empty pulls do not serialize/write the snapshot or change data revisions. Cursor-only and mutation-queue changes remain durable without invalidating unchanged row data.

Offline-created resources should use declarative text IDs:

[resources.checkins]
id_type = "text"

See the Loomup documentation for sync protocol and conflict behavior.