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

@rajeev02/sync

v0.2.2

Published

Offline-first sync engine with CRDT conflict resolution, Hybrid Logical Clock ordering, persistent operation log, and multi-device convergence

Downloads

166

Readme

@rajeev02/sync

npm

Offline-first sync engine with CRDT-based conflict resolution, Hybrid Logical Clock causal ordering, persistent operation log, and multi-device convergence.

Powered by a Rust core (rajeev-sync-core) compiled to native (iOS/Android via UniFFI) and WASM (Web).

Platform Support

| Platform | Engine | Binding | | -------------------- | ------------ | --------------- | | iOS 16+ | Rust → UniFFI | Swift | | Android 7+ (API 24) | Rust → UniFFI | Kotlin | | Web | Rust → WASM | wasm-bindgen | | watchOS 9+ / Wear OS | Rust → UniFFI | Native | | Android Auto | Rust → UniFFI | Kotlin |

Installation

npm install @rajeev02/sync

Quick Start

import { SyncStorage } from '@rajeev02/sync';

// Each device gets a unique node ID
const storage = new SyncStorage(':memory:', 'device-phone-01');

// Insert documents
const docId = storage.insert('tasks', JSON.stringify({
  title: 'Buy groceries',
  done: false,
}));

// Update fields
storage.update('tasks', docId, 'done', 'true');

// Query
const tasks = storage.query('tasks', 10);

// Get unsynced operations for server push
const ops = storage.getUnsyncedOps(100);

// After server confirms receipt
storage.markSynced(ops.map(op => op.id));

CRDT Documents

import { CrdtDocument, lwwMerge, HLC } from '@rajeev02/sync';

// Create documents on two devices
const docA = CrdtDocument.create('doc-001', 'tasks', 'device-A');
const docB = CrdtDocument.create('doc-001', 'tasks', 'device-B');

// Both edit the same field
docA.setField('title', 'Buy pasta');
docB.setField('title', 'Buy rice');

// Merge — later HLC wins deterministically
docA.merge(docB);
docB.merge(docA);
// Both converge to the same value ✅

API Reference

| Method | Description | |--------|-------------| | SyncStorage(dbPath, nodeId) | Create sync storage instance | | insert(collection, dataJson) | Insert document, returns UUID | | update(collection, docId, field, value) | Update single field | | delete(collection, docId) | Soft-delete document | | get(collection, docId) | Get document as JSON | | query(collection, limit) | Query documents in collection | | getUnsyncedOps(limit) | Get unsynced ops for server push | | markSynced(opIds) | Mark ops as synced | | purgeOldOps(hours) | Remove old synced ops | | getStats() | Storage statistics | | CrdtDocument.create(id, collection, nodeId) | Create CRDT document | | HLC(nodeId) | Create Hybrid Logical Clock | | compareHLC(a, b) | Compare two HLC timestamps | | lwwMerge(local, remote) | Last-Writer-Wins merge |

License

MIT © Rajeev Kumar Joshi