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

@package-broker/cloudflare

v0.10.4

Published

Interactive CLI tool for deploying PACKAGE.broker to Cloudflare Workers

Downloads

56

Readme

@package-broker/cloudflare

CLI tool for deploying PACKAGE.broker to Cloudflare Workers with one command. Supports both interactive and CI/CD modes.

Installation

npm install @package-broker/cloudflare @package-broker/main

Usage

Interactive Mode (Default)

npx package-broker-cloudflare init

The CLI will:

  • Prompt for tier selection (free/paid)
  • Prompt for worker name
  • Generate encryption key
  • Create Cloudflare resources (D1, KV, R2, Queue if paid)
  • Set encryption key as Cloudflare secret
  • Generate wrangler.toml with all IDs populated
  • Copy migration files
  • Optionally deploy the Worker

CI/CD Mode

For non-interactive deployment in GitHub Actions or other CI environments:

npx package-broker-cloudflare deploy --ci --json \
  --worker-name my-worker \
  --tier free \
  --domain app.example.com

Required Environment Variables (CI mode):

  • CLOUDFLARE_API_TOKEN - Cloudflare API token with required permissions
  • CLOUDFLARE_ACCOUNT_ID - Your Cloudflare account ID
  • ENCRYPTION_KEY - Base64-encoded encryption key

Optional Environment Variables:

  • WORKER_NAME - Worker name (overrides --worker-name flag)
  • CLOUDFLARE_TIER - free or paid (overrides --tier flag)
  • DOMAIN - Custom domain (overrides --domain flag)
  • SKIP_UI_BUILD - Set to true to skip UI build step
  • SKIP_MIGRATIONS - Set to true to skip migration application

Flags:

  • --ci - Enable CI mode (non-interactive, no prompts)
  • --json - Output JSON result for machine parsing
  • --worker-name <name> - Worker name
  • --tier <free|paid> - Cloudflare tier
  • --domain <domain> - Custom domain (e.g., app.example.com)
  • --skip-ui-build - Skip UI build step
  • --skip-migrations - Skip migration application

JSON Output (when using --json):

{
  "worker_url": "https://my-worker.workers.dev",
  "database_id": "abc123...",
  "kv_namespace_id": "def456...",
  "r2_bucket_name": "my-worker-artifacts",
  "queue_name": "my-worker-queue"
}

Features

  • Interactive setup: Guided prompts for configuration
  • CI/CD mode: Non-interactive deployment with JSON output for automation
  • Idempotent: Safe to re-run if resources already exist
  • Automatic resource creation: D1, KV, R2, and Queue (paid tier)
  • Secret management: Encryption key set as Cloudflare secret (not in wrangler.toml)
  • Migration handling: Automatically copies and applies migrations
  • Tier-aware: Different configuration for free vs paid tiers
  • Wrangler version pinning: Enforces wrangler@^4.54.0 as dependency

Requirements

  • Node.js 18+
  • Cloudflare account
  • Authenticated with wrangler login (interactive mode) or CLOUDFLARE_API_TOKEN environment variable (CI mode)

See Also