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

edgebase-worker

v0.1.0

Published

EdgeBase Worker - Cloudflare Workers deployment (uses published npm packages)

Downloads

7

Readme

EdgeBase Worker - Example Deployment

This is an example deployment of EdgeBase using published NPM packages.

For External Users: This demonstrates how to use @edgebasejs/worker and the EdgeBase CLI to deploy a complete backend to Cloudflare Workers, independently from the monorepo.

This package is the Cloudflare Workers backend only.
The admin UI is deployed separately via @edgebasejs/admin-console and connects to this worker URL.

Features

  • Auth: Login/Register with email and password
  • Todos CRUD: Create, read, update, delete todos
  • User Isolation: Each user only sees their own todos
  • Session Management: Token-based authentication

Schema & Migrations

  • Schema source: apps/worker/edgebase.schema.ts
  • Migrations: apps/worker/migrations/*.sql
  • Worker entrypoint: apps/worker/src/index.ts (EdgeBase worker factory)

Generate SDK + migrations after schema changes:

cd apps/worker
npx edgebase generate

Apply migrations to local D1:

cd apps/worker
npx edgebase migrate

Note: In development, the worker can auto-initialize tables from the schema. In production, run migrations explicitly.

Quick Start

# Install dependencies
npm install

# Start worker development server
npm run dev
# Opens: http://localhost:8787 (Worker API)

Start admin console separately (in another terminal):

cd ../admin-console
npm run dev
# Opens: http://localhost:3001
# First open asks for Worker URL (e.g. http://localhost:8787)

Build/publish commands are available via the EdgeBase CLI:

# Start development
npm run dev

# Build for deployment
npm run build

# Deploy to Cloudflare Workers
npm run deploy

# Publish to npm
npm run publish

API Endpoints

Auth

# Login
curl -X POST http://localhost:8787/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"password123"}'

# Register
curl -X POST http://localhost:8787/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"password123"}'

Todos

TOKEN="..." # From login response

# Create todo
curl -X POST http://localhost:8787/todos \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Buy milk","completed":false}'

# Get all todos
curl http://localhost:8787/todos \
  -H "Authorization: Bearer $TOKEN"

# Get single todo
curl http://localhost:8787/todos/TODOID \
  -H "Authorization: Bearer $TOKEN"

# Update todo
curl -X PATCH http://localhost:8787/todos/TODOID \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"completed":true}'

# Delete todo
curl -X DELETE http://localhost:8787/todos/TODOID \
  -H "Authorization: Bearer $TOKEN"

Storage

Uses Cloudflare D1 (SQLite). System tables and entity tables are managed via EdgeBase migrations.

Deployment

# Build for production
npm run build

# Deploy to Cloudflare Workers
npm run deploy

# Or publish worker package
npm run publish

Set environment variables in wrangler.toml for production.

About the Admin Console

The admin console is a separate deployment:

  • Uses this worker via its URL
  • On first start it asks for the Worker URL
  • Supports login with an existing admin account
  • Supports first-admin setup when no admin exists yet

Architecture

Client (React Native + Expo)
    ↓
EdgeBase SDK
    ↓
This Worker (REST API)
    ↓
In-Memory Storage (or D1 in production)

The app communicates with this worker via HTTP. The SDK handles:

  • Authentication (token management)
  • Offline-first caching
  • Sync logic
  • Query caching