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

@craftthingy-digital-innovation/cty-smart-merge-sync-web

v1.0.2

Published

Bilingual documentation: [Bahasa Indonesia](#bahasa-indonesia) | [English](#english)

Readme

@craftthingy-digital-innovation/cty-smart-merge-sync-web

Bilingual documentation: Bahasa Indonesia | English


Bahasa Indonesia

Library client-side Javascript untuk menangani kolaborasi sinkronisasi data real-time multi-user. Menggunakan algoritma Smart Merge untuk menyinkronkan data perubahan server tanpa merusak kursor ketik aktif pengguna (document.activeElement) dan tanpa menimpa perubahan lokal yang sedang mengantre di outbox.

Sangat cocok untuk merancang UI kolaboratif seperti Google Sheets, dashboard multi-user, atau sistem input data bersama.

Instalasi

npm install @craftthingy-digital-innovation/cty-smart-merge-sync-web

Cara Penggunaan

import { SmartSyncEngine } from '@craftthingy-digital-innovation/cty-smart-merge-sync-web';

const syncEngine = new SmartSyncEngine({
  interval: 4000, // Ambil data dari server setiap 4 detik
  fetchData: async () => {
    const res = await fetch('/api/entries');
    const result = await res.json();
    return result.data; // Mengembalikan array data terbaru
  },
  isPendingLocal: (uuid, field) => {
    // Return true jika baris/kolom ini sedang memiliki antrean simpan offline
    return myOfflineQueue.hasPending(uuid, field);
  },
  fields: ['no_paspor', 'nama_pemohon', 'tempat_lahir'] // Kolom yang disinkronkan
});

// Jalankan polling sinkronisasi
syncEngine.start();

syncEngine.on('sync', (remoteList) => {
  // Gabungkan data remote ke state lokal & perbarui DOM secara aman
  syncEngine.merge(localEntries, remoteList, {
    onAdd: (newItem) => {
      // Tambahkan baris baru ke tabel DOM Anda
      appendRowToTableDOM(newItem);
    },
    onDelete: (uuid) => {
      // Hapus baris dari tabel DOM Anda
      removeRowFromTableDOM(uuid);
    },
    onUpdateField: (uuid, field, val) => {
      // Perbarui nilai input kolom spesifik di DOM
      const input = document.querySelector(`tr[data-uuid="${uuid}"] .field-${field}`);
      if (input) input.value = val;
    }
  });
});

English

A client-side JavaScript library to coordinate real-time multi-user data synchronization. Employs a Smart Merge algorithm to merge database updates without causing cursor jumps, losing user's focus (document.activeElement), or overwriting pending local outbox edits.

Perfect for collaborative UIs such as shared spreadsheets, multi-user dashboards, or shared forms.

Installation

npm install @craftthingy-digital-innovation/cty-smart-merge-sync-web

Usage

import { SmartSyncEngine } from '@craftthingy-digital-innovation/cty-smart-merge-sync-web';

const syncEngine = new SmartSyncEngine({
  interval: 4000, // Poll server every 4 seconds
  fetchData: async () => {
    const res = await fetch('/api/entries');
    const result = await res.json();
    return result.data; // Return latest remote array
  },
  isPendingLocal: (uuid, field) => {
    // Return true if this row/field has pending local saves in your outbox
    return myOfflineQueue.hasPending(uuid, field);
  },
  fields: ['no_paspor', 'nama_pemohon', 'tempat_lahir'] // Fields to merge
});

// Start collaboration polling
syncEngine.start();

syncEngine.on('sync', (remoteList) => {
  // Merge remote data into local state & DOM safely
  syncEngine.merge(localEntries, remoteList, {
    onAdd: (newItem) => {
      // Add new row to your table DOM
      appendRowToTableDOM(newItem);
    },
    onDelete: (uuid) => {
      // Remove row from your table DOM
      removeRowFromTableDOM(uuid);
    },
    onUpdateField: (uuid, field, val) => {
      // Update specific input element value in the DOM
      const input = document.querySelector(`tr[data-uuid="${uuid}"] .field-${field}`);
      if (input) input.value = val;
    }
  });
});