runtime support

yaebal is fetch-first and has zero native-module dependencies in the core, so Bun, Deno, and edge runtimes like Cloudflare Workers work out of the box. This page lists what runs where.

support matrix

featureNodeBunDenoCF Workers / edge
@yaebal/core + most plugins
@yaebal/webwebhook()
nodeWebhookCallback (node http)✅ (compat)✅ (compat)❌ no node:http
@yaebal/panel❌ needs fs
@yaebal/router (file-based)❌ needs fs
@yaebal/workers (thread pool)⚠️ limited❌ no worker_threads
create-yaebal (CLI)N/A
why fetch-first? The Fetch API is the one HTTP primitive shared by Node 18+, Bun, Deno, and all edge runtimes. By building on (Request) => Promise<Response> instead of (req, res), yaebal adapters work everywhere without shims.

Cloudflare Workers

webhook() from @yaebal/web returns a standard fetch handler, so you can drop it directly into a Workers export. No adapter needed, no Node compatibility flag required.

worker.ts
// Cloudflare Workers — fetch-first, runs at the edge
import { Bot } from "@yaebal/core";
import { webhook } from "@yaebal/web";

const bot = new Bot(env.BOT_TOKEN);
bot.command("start", (ctx) => ctx.reply("hi from the edge"));

export default { fetch: webhook(bot) };

Bun

Pass the same fetch handler to Bun.serve. Bun's Node compatibility layer means you can also use nodeWebhookCallback with Bun.serve's node:http-style API if you prefer, but the fetch path is simpler.

server.ts
// Bun — built-in HTTP server
import { Bot } from "@yaebal/core";
import { webhook } from "@yaebal/web";

const bot = new Bot(process.env.BOT_TOKEN!);
bot.on("message:text", (ctx) => ctx.reply(ctx.text));

Bun.serve({ port: 8080, fetch: webhook(bot) });

Deno

Deno.serve accepts a fetch handler directly. Import from npm via Deno's npm specifier support (npm:@yaebal/core) or use a local build.

server.ts
// Deno — built-in HTTP server
import { Bot } from "@yaebal/core";
import { webhook } from "@yaebal/web";

const bot = new Bot(Deno.env.get("BOT_TOKEN")!);
bot.on("message:text", (ctx) => ctx.reply(ctx.text));

Deno.serve({ port: 8080 }, webhook(bot));

edge limitations

Edge runtimes (Cloudflare Workers, Deno Deploy, Vercel Edge) don't expose the filesystem or worker_threads, so anything that relies on those won't run there:

  • @yaebal/panel — serves a static admin UI from disk; needs fs
  • @yaebal/router — discovers handler files at startup; needs fs
  • @yaebal/workers — spawns a worker_threads pool; not available at the edge
  • nodeWebhookCallback — uses node:http types; polyfills vary

Everything else — core, all filter/keyboard/session/i18n plugins, webhook() — runs fine at the edge.