cloudflare-to-bun_skill

This skill assists migrating Cloudflare Workers to Bun by analyzing compatibility, converting APIs, and mapping bindings for server deployments.

3

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill daleseo/bun-skills --skill cloudflare-to-bun

  • SKILL.md10.8 KB

Overview

This skill helps migrate Cloudflare Workers to Bun by providing runtime compatibility analysis, bindings replacements, and deployment guidance. It focuses on converting Cloudflare runtime APIs, mapping KV/R2/D1/Durable Objects to server-side alternatives, and adapting edge patterns to Bun server deployments. Use it when you need a clear, repeatable path from Workers to Bun-based servers.

How this skill works

The skill analyzes your worker type (service, module, scheduled, durable object, or pages function), inspects wrangler.toml and bindings, and maps Cloudflare APIs to Bun equivalents. It produces concrete code patterns for request/response handlers, routing (with Hono), scheduled jobs, and recommended replacements for KV, R2, and D1. It also provides configuration and deployment templates, environment variable migration, testing tips, and a migration checklist.

When to use it

  • Converting a Cloudflare Worker (module or service) to a Bun server
  • Replacing Cloudflare bindings (KV, R2, D1, Durable Objects) with Redis, S3, or SQL
  • Moving from edge deployment to a self-hosted or cloud server setup
  • Adapting scheduled Cron triggers and background tasks to Bun
  • Preparing a migration plan that includes testing and deployment strategies

Best practices

  • Start with a pre-migration analysis: verify wrangler.toml, worker type, and Bun installation
  • Map bindings explicitly (KV→Redis, R2→S3, D1→Postgres/SQLite) and provision replacements before cutover
  • Use a routing framework like Hono to replicate Worker route patterns and middleware
  • Migrate environment variables into .env files and use process.env in runtime
  • Containerize with Docker and include health checks and monitoring for server deployments

Example use cases

  • Migrate an API built on Cloudflare Workers to Bun using Hono for routing and Redis for KV-like cache
  • Convert a scheduled cleanup Worker into a Bun server job using node-cron and a Docker deployment
  • Replace R2-backed asset serving with S3-compatible storage and the AWS SDK in Bun
  • Move Durable Object stateful logic to a PostgreSQL-backed service with connection pooling
  • Set up a local test flow: run Bun server, migrate tests from Miniflare to bun:test, and verify endpoints

FAQ

No. Bun uses a server runtime with different primitives. The skill maps common APIs and offers patterns or libraries (Hono, ioredis, AWS SDK) to replace Cloudflare-specific bindings.

How do I handle scheduled (cron) Workers in Bun?

Use a scheduler library like node-cron or your cloud provider's scheduled functions, and run the scheduler alongside the Bun server or as a separate worker service.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational