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

tauri-plugin-sync

v0.1.2

Published

Zero-Configuration Local-First SQLite Replication & Sync Engine for Tauri v2

Downloads

523

Readme

tauri-plugin-sync

Zero-Configuration Local-First SQLite Replication & Sync Engine for Tauri v2.

npm Crates.io License: MIT Tauri v2 Tests

tauri-plugin-sync enables developers to build real-time, offline-first desktop applications with Tauri v2. Write to local SQLite with sub-millisecond median latency (0.13ms p50 / 0.34ms mean), and let the background sync engine seamlessly replicate changesets to your remote cloud backend with deterministic Last-Write-Wins (LWW) conflict resolution.


Features

  • ⚡ Sub-Millisecond Local Writes: Median (p50) latency of 0.13ms and mean latency of 0.34ms with zero network blocking.
  • 🔄 Automatic Change Data Capture (CDC): Shadow triggers track inserts, updates, and deletes without changing existing application SQL.
  • 📴 Offline-First Resilience: Network disconnects queue mutations locally; auto-sync resumes instantly when back online.
  • 🛡️ Deterministic Conflict Resolution: Last-Write-Wins (LWW) with microsecond tiebreakers and tombstone deletion support.
  • 🔁 Infinite Loop Immunity: Session-level recursion suppression guarantees inbound sync never re-triggers local CDC triggers.
  • 📦 Modern TypeScript SDK: Full TypeScript definitions, reactive status listeners, and manual sync controls.

Installation

1. Install JavaScript / TypeScript SDK

npm install tauri-plugin-sync
# or
pnpm add tauri-plugin-sync
# or
yarn add tauri-plugin-sync

2. Add Rust Backend Crate

In your src-tauri/Cargo.toml:

[dependencies]
tauri-plugin-sync = "0.1"

Quick Start

Frontend (TypeScript / JavaScript)

import { SyncManager } from 'tauri-plugin-sync';

// 1. Initialize Sync with your local SQLite database
const sync = await SyncManager.init({
  database: 'app.db',
  endpoint: 'https://api.example.com/sync',
  tables: ['todos', 'notes'],
  authHeader: 'Bearer eyJhbGciOi...',
  syncIntervalMs: 5000, // background polling interval (ms)
  batchSize: 500,       // maximum changes per batch
});

// 2. Listen to reactive sync status ('idle' | 'syncing' | 'offline' | 'error')
sync.onStatusChange(({ state, pendingCount, lastSyncTime }) => {
  console.log(`Sync Status: ${state} (Pending: ${pendingCount})`);
});

// 3. Trigger manual synchronization on demand
await sync.syncNow();

Backend (Rust / Tauri v2)

In src-tauri/src/lib.rs (or main.rs):

use tauri_plugin_sync::Builder as SyncBuilder;

pub fn run() {
    tauri::Builder::default()
        .plugin(
            SyncBuilder::new()
                .database("app.db")
                .endpoint("https://api.example.com/sync")
                .bearer_token("YOUR_AUTH_TOKEN") // Securely managed in Rust backend (XSS-safe)
                .tables(vec!["notes".into(), "todos".into()])
                .sync_interval(std::time::Duration::from_secs(5))
                .build()
        )
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Verified Benchmarks (1,000 Iteration Sample)

| Test Scenario | Measurement | Benchmark Result | Architectural Guarantee | | :--- | :--- | :---: | :--- | | Local SQLite Mutation (p50) | Single-row INSERT / UPDATE | 0.13 ms (p50) | Pure local execution; zero network blocking | | Local SQLite Mutation (Mean) | Average across 1,000 rows | 0.34 ms (mean) | Sustained unbatched writes | | Local SQLite Mutation (p99) | Tail latency during checkpoint | 1.00 ms (p99) | Predictable performance even during WAL checkpointing | | CDC Trigger Overhead (p50) | Shadow table changelog capture | < 0.09 ms (p50) | Seamless delta logging with zero application refactoring | | Concurrent Write Stress | 10 concurrent threads × 100 ops | 1,000 ops in ~1.02s | Zero database locked errors via WAL mode busy timeout | | Conflict Convergence | LWW timestamp vs. Tombstones | Deterministic | Deletions strictly defeat stale historical updates | | Schema Drift Resilience | Unexpected server-side columns | Zero failures | Local engine strips unknown columns gracefully |


Resources & Documentation


License

MIT OR Apache-2.0. Copyright (c) 2026 Chitresh (Kxrn) Gupta (Gupta Ventures).