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

@softwareseva/sync

v1.6.0

Published

Offline-first sync for Hono on Cloudflare Workers + D1: idempotent batched push of client operations with replay, and a change log with a monotonic cursor for pulling upserts and deletes per scope. Pairs with the kashi_sync Flutter package.

Readme

@softwareseva/sync

Offline-first sync for the kashi stack: idempotent batched push, a cursor-based pull, and a React client built on RxDB + TanStack DB. kashi_sync is the Flutter half.

Install

pnpm add @softwareseva/sync hono zod
# React client also needs:
pnpm add rxdb @tanstack/db

What's inside

  • @softwareseva/sync (root import, Hono on Cloudflare Workers + D1): syncRouter() mounts POST /push and GET /pull; changeStatement() / recordChanges() log changes from any ordinary route so web edits reach mobile devices too.
    • POST /push { ops: [{ opId, type, payload }] }: each op runs its handler once. The result is stored by (user, opId), so a retried batch replays results instead of applying twice. Failures report retryable so clients know whether to back off or give up.
    • GET /pull?since=<seq>: returns { changes: { <entity>: { upserts, deletes } }, next, hasMore, reset } from the sync_changes log for the user's scopes. The cursor is a monotonically increasing sequence, so resuming is exact.
  • @softwareseva/sync/client: SyncEngine — an RxDB-backed outbox of ops plus a pull cursor, mirroring kashi_sync's Dart engine.
  • @softwareseva/sync/react: createSyncedCollection() — a TanStack DB collection backed by an RxDB collection, with live reads and writes that enqueue an op on the SyncEngine in the same call; useSyncStatus() for a status badge (idle / syncing / offline / failed, pending count, needs-attention count). See the react-offline-sync skill.
  • kashi_sync (pub.dev, Flutter): the same outbox-and-cursor design on Drift. See the flutter-drift-sync skill.

Example

app.route("/v1/sync", syncRouter({
  auth: requireAuth(authConfig),
  user: (c) => c.get("user"),
  scopes: (user) => [`user:${user.id}`],
  handlers: { "note.upsert": { schema: noteSchema, apply: (ctx, p) => { ctx.batch.push(upsertNote(ctx.db, p)); ctx.changed({ scope: `user:${ctx.user.id}`, entity: "notes", id: p.id }); return { id: p.id }; } } },
  entities: { notes: { load: (db, ids, user) => loadNotes(db, ids, user.id) } },
}));

Migrations

Ships migrations/sync_0001_ops_changes.sql; copy it into your migrations directory with npx @softwareseva/cli migrate.

See also

sync-endpoints (server), react-offline-sync (React), and flutter-drift-sync (kashi_sync) skills.