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-offline-outbox-sync-web

v1.0.1

Published

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

Readme

@craftthingy-digital-innovation/cty-offline-outbox-sync-web

Bilingual documentation: Bahasa Indonesia | English


Bahasa Indonesia

Library client-side Javascript untuk menangani pengiriman data otomatis (auto-save) dengan kemampuan penyimpanan lokal sementara (localStorage outbox) dan pencobaan ulang otomatis (auto-retry) berkala jika koneksi terputus.

Sangat berguna untuk aplikasi web yang membutuhkan persistensi tinggi (seperti spreadsheet, form panjang, CRM) agar terhindar dari kehilangan data saat jaringan buruk.

Instalasi

npm install @craftthingy-digital-innovation/cty-offline-outbox-sync-web

Cara Penggunaan

import { OfflineOutbox } from '@craftthingy-digital-innovation/cty-offline-outbox-sync-web';

const outbox = new OfflineOutbox({
  storageKey: 'paspor_offline_queue', // Kunci localStorage
  retryInterval: 6000, // Waktu tunggu coba kembali (6 detik)
  onSync: async (item) => {
    // Jalankan pengiriman data asinkron Anda ke server
    const response = await fetch('/api/save', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(item.postData)
    });
    return await response.json();
  }
});

// Masukkan perubahan data ke outbox (akan di-merge otomatis jika UUID sama)
outbox.enqueue('row-uuid-123', { nama_pemohon: 'Alif Nurhidayat' });

// Dengarkan perubahan status sinkronisasi untuk update UI badge
outbox.on('status-change', ({ pendingCount, online }) => {
  if (!online) {
    updateStatusUI(`Koneksi terputus. Menyimpan lokal... (${pendingCount} tertunda)`);
  } else if (pendingCount > 0) {
    updateStatusUI(`Menyinkronkan... (${pendingCount} perubahan)`);
  } else {
    updateStatusUI('Semua data tersimpan otomatis');
  }
});

English

A client-side JavaScript library to handle automatic form submissions (auto-save) with local cache fallback (localStorage outbox) and periodic auto-retry capabilities when connections are disrupted.

Extremely useful for sheets, databases, long forms, or CRMs to prevent data loss on unstable networks.

Installation

npm install @craftthingy-digital-innovation/cty-offline-outbox-sync-web

Usage

import { OfflineOutbox } from '@craftthingy-digital-innovation/cty-offline-outbox-sync-web';

const outbox = new OfflineOutbox({
  storageKey: 'paspor_offline_queue', // Key in localStorage
  retryInterval: 6000, // Retry interval (6 seconds)
  onSync: async (item) => {
    // Execute your async API save request
    const response = await fetch('/api/save', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(item.postData)
    });
    return await response.json();
  }
});

// Enqueue changes (automatically merged if same UUID is modified)
outbox.enqueue('row-uuid-123', { nama_pemohon: 'Alif Nurhidayat' });

// Listen for status changes to update your UI indicators
outbox.on('status-change', ({ pendingCount, online }) => {
  if (!online) {
    updateStatusUI(`Connection offline. Saved locally (${pendingCount} pending)`);
  } else if (pendingCount > 0) {
    updateStatusUI(`Syncing... (${pendingCount} changes)`);
  } else {
    updateStatusUI('All data saved automatically');
  }
});