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

convex-versioned-assets-sync

v0.2.1

Published

Real-time sync daemon for convex-versioned-assets - mirrors Convex assets to local filesystem

Readme

convex-versioned-assets-sync

Real-time sync daemon for convex-versioned-assets - mirrors your Convex assets to the local filesystem.

Features

  • Real-time sync via WebSocket subscription
  • Initial sync on first run (catches up on all existing assets)
  • Incremental updates using changelog cursors (never misses changes)
  • macOS launchd integration for auto-start on boot
  • Multiple project support - run separate daemons for different projects

Prerequisites

  • Bun runtime (v1.0.0 or later)
  • convex-versioned-assets component set up in your Convex project
  • CONVEX_URL and CONVEX_ADMIN_KEY in your project's .env file

Installation

# Install globally
npm install -g convex-versioned-assets-sync

# Or with bun
bun add -g convex-versioned-assets-sync

Setup

Before using the sync daemon, you need to set up the convex-versioned-assets component in your Convex project:

# Install the component
npm install convex-versioned-assets

# Run the setup (creates required Convex functions)
npx convex-versioned-assets setup

# Deploy to Convex
npx convex dev

Make sure your .env file contains:

CONVEX_URL=https://your-deployment.convex.cloud
CONVEX_ADMIN_KEY=your-admin-key

Usage

Install as a Background Daemon (Recommended)

# Navigate to your project directory
cd /path/to/myproject

# Install the daemon (uses folder name as project name)
convex-versioned-assets-sync install

# Or with explicit name
convex-versioned-assets-sync install --name custom-name

The daemon will:

  • Start immediately and perform an initial sync
  • Auto-start on system boot (macOS)
  • Restart automatically if it crashes

Manual Run (for testing)

# Run directly in foreground
convex-versioned-assets-sync run

Managing Daemons

# List all installed daemons
convex-versioned-assets-sync list

# Uninstall a daemon
convex-versioned-assets-sync uninstall --name myproject

# View logs
tail -f ~/Library/Logs/ConvexSync/myproject/stdout.log

# Stop/start manually
launchctl unload ~/Library/LaunchAgents/com.convex-versioned-assets.sync.myproject.plist
launchctl load ~/Library/LaunchAgents/com.convex-versioned-assets.sync.myproject.plist

Configuration

The daemon reads configuration from multiple sources (in order of precedence):

  1. Command-line arguments
  2. Environment variables (from .env file)
  3. Config file (~/.convex-sync.toml)
  4. Default values

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | CONVEX_URL | Your Convex deployment URL | (required) | | CONVEX_ADMIN_KEY | Admin key for authentication | (required) | | CONVEX_SYNC_DIR | Directory to sync assets to | ./versioned-assets | | CONVEX_SYNC_CONCURRENCY | Parallel download limit | 10 |

Config File (~/.convex-sync.toml)

sync_dir = "./versioned-assets"
concurrency = 10

Multiple Projects

You can run separate sync daemons for different projects:

# Project 1 (uses folder name "project1")
cd /path/to/project1
convex-versioned-assets-sync install

# Project 2 (uses folder name "project2")
cd /path/to/project2
convex-versioned-assets-sync install

# Each has independent logs and state
tail -f ~/Library/Logs/ConvexSync/project1/stdout.log
tail -f ~/Library/Logs/ConvexSync/project2/stdout.log

How It Works

  1. Initial Sync: On first run, fetches all folders and files from your Convex deployment
  2. Cursor Tracking: Stores a compound cursor (timestamp + ID) to track sync position
  3. WebSocket Subscription: Subscribes to real-time changelog updates
  4. File Management: Downloads new/updated files, deletes removed files, handles renames and moves
  5. Version Tracking: Uses extended attributes (xattr) to track file versions locally

Troubleshooting

"Missing required Convex function" error

Run the setup command in the main package:

npx convex-versioned-assets setup
npx convex dev

"Authentication failed" error

Make sure CONVEX_ADMIN_KEY in your .env matches the one set in your Convex deployment environment variables.

Daemon not starting

Check the logs:

tail -f ~/Library/Logs/ConvexSync/myproject/stderr.log

Reset sync state

Delete the state file and restart:

rm .convex-sync-state.json
convex-versioned-assets-sync uninstall --name myproject
convex-versioned-assets-sync install --name myproject

License

MIT