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 🙏

© 2025 – Pkg Stats / Ryan Hefner

replic-sqlite

v0.2.12

Published

Simple, Fast, Multi-writer, Convergent, Replicated SQLite with 800 LOC only

Readme

Replic-sqlite

⚠️ WIP Notice: This project is still under active development. Do NOT use in production yet.

replic-sqlite is a lightweight Node.js / Bun.js module that adds multi-writer, Conflict-Free replication to SQLite — without performance compromises.

✨ Philosophy & Core Features

  • 🧩 Tiny & Transparent – ~800 LOC, no hidden magic.
  • 🚀 Performance First – avoids expensive ops (like excessive JSON parsing).
  • 🔀 True Multi-Writer – no master, no leader bottlenecks.
  • 📚 CRDT at the Core – each row is replicated conflict-free.
  • 🛡️ No Single Point of Failure – designed for resilience.
  • 🔄 Eventual Consistency – replicas may diverge temporarily, but always converge.
  • 👤 Read-Your-Own-Writes (optional) – via session token or reverse proxy.
  • 🌐 Protocol Agnostic – WebSocket, TCP, HTTP, UDP, Pub/Sub — your choice.
  • 🕸️ Flexible Topologies – hub-and-spoke, mesh, hybrid.
  • 📦 Dependency-Light – only depends on SQLite itself.
  • 🔧 Rolling Upgrades – live DB migration system for upgrades/downgrades.
  • 🛸 Alien-Compatible – handles heterogeneous DB schemas across the cluster, making rolling upgrades transparent
  • 💤 Crash-Safe – survives stop/restart with automatic recovery.
  • 💪 Self-Healing – handles packet loss, reordering, clock drift.
  • ⚙️ Embedded-Friendly – drop it directly into your app.
  • 📊 Open Metrics – built-in observability.
  • 🎯 Selective Replication – only tables with _patches tables are synced.
  • 🌩️ Serverless-Friendly – automatic snapshot/backup/recovery to external object storage.

🚀 Why Replic-sqlite?

A better alternative to libSQL, Turso, Bedrockdb, cr-sqlite, dqlite, rqlite, and litestream if you use embedded SQLite with Node.js or Bun.sh.

More information coming soon.

Known Limits

  • Tables are patched independently, so constraints between tables cannot be used.
    This issue can be addressed later using a "group patch" feature.
  • Direct Insert/Delete/Update request are forbidden in synchronized tables, unless you know what you do

Prerequisites

  1. Every table in your database must have:
    • A primary key
    • A separate table to store temporary patches, with three reserved and mandatory columns:
      • _patchedAt : 53bits number (Unix timestamp in millisecond)
      • _sequenceId : 64bits Consecutive sequence number of change per peer
      • _peerId : 32bits globally unique, Source of change
  /* Your table */
  CREATE TABLE myTable (
    id            INTEGER NOT NULL,
    tenantId      INTEGER NOT NULL,
    name          TEXT,
    deletedAt     INTEGER,
    
    PRIMARY KEY (id, tenantId)
  ) STRICT;

  /* YOU MUST CREATE THE CORRESPONDING TABLE IN YOUR MIGRATIONS */
  CREATE TABLE myTable_patches (
    _patchedAt    INTEGER  NOT NULL,
    _sequenceId   INTEGER  NOT NULL,
    _peerId       INTEGER  NOT NULL,
      
    id            INTEGER NOT NULL,
    tenantId      INTEGER NOT NULL,
    name          TEXT,
    deletedAt     INTEGER
  ) STRICT;
  1. Direct DELETE is forbidden. The nature of CRDTs requires that a deletion must be a patch with deletedAt.

📅 Roadmap

Additional documentation, examples, and usage guides are on the way. Stay tuned!

❤️ Contributing

This is an early-stage project — feedback, ideas, and contributions are very welcome!

📜 License

Apache-2.0