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

@yaebal/web

v0.1.1

Published

yaebal web — run your bot on edge/web runtimes (cloudflare workers, deno, bun) via webhooks.

Readme

@yaebal/web

run your yaebal bot on any runtime via webhooks — edge (cloudflare workers, deno deploy, bun, vercel edge), node servers (express, fastify, koa), serverless (aws lambda, azure functions, google cloud functions), and modern fetch frameworks (hono, elysia, next.js, sveltekit). fetch-first, zero static node: imports.

install

pnpm add @yaebal/web

fetch-native runtimes

webhook(bot, options?) returns a standard (Request) => Promise<Response>. that's everything a fetch runtime needs:

import { Bot } from "@yaebal/core";
import { webhook, setWebhook } from "@yaebal/web";

const bot = new Bot(BOT_TOKEN, { botInfo: BOT_INFO }); // botInfo skips the getMe round-trip
bot.command("start", (ctx) => ctx.reply("running on the edge ⚡"));

// cloudflare workers / deno deploy / vercel edge / hono / elysia
export default { fetch: webhook(bot, { secretToken: SECRET }) };

register the webhook once, from a separate deploy script (never at module top level on edge):

await setWebhook(bot, "https://my-worker.workers.dev/", {
  secretToken: SECRET,
  allowedUpdates: ["message", "callback_query"],
  dropPendingUpdates: true,
});

framework adapters

for frameworks whose handler shape isn't (Request) => Response:

import { expressAdapter, fastifyAdapter, honoAdapter, awsLambdaAdapter } from "@yaebal/web";

app.post("/", expressAdapter(bot, { secretToken: SECRET }));       // express / gcf / firebase
fastify.post("/", fastifyAdapter(bot, { secretToken: SECRET }));   // fastify
app.post("/", honoAdapter(bot, { secretToken: SECRET }));          // hono (wires waitUntil)
export const handler = awsLambdaAdapter(bot, { secretToken: SECRET }); // aws lambda

full set: honoAdapter, elysiaAdapter, cloudflareAdapter, nextAdapter, svelteKitAdapter, expressAdapter, gcfAdapter, fastifyAdapter, koaAdapter, awsLambdaAdapter, azureAdapter — also grouped on the adapters object (adapters.express(bot)). every adapter forwards the secret token and the request path, so secretToken and path behave identically across all of them.

standalone server (node / bun / deno)

serve(bot, options?) starts the runtime's native http server and resolves to a handle you can stop(). it works on node too (lazily importing node:http), so there's no special-casing:

import { serve } from "@yaebal/web";

const server = await serve(bot, { port: 8080, secretToken: SECRET });
process.once("SIGINT", () => server.stop());
console.log(`listening on ${server.url}`);

production hardening

these are the pieces every serious webhook deployment needs — telegram fires updates in parallel and redelivers on failure:

import { sequentialize, dedupe, isTelegramIp } from "@yaebal/web";

bot.use(sequentialize()); // per-chat ordering — install before session/scenes/conversation
bot.use(dedupe());        // drop telegram's redelivered update_ids

// defence in depth on top of the secret token
if (!isTelegramIp(request.headers.get("cf-connecting-ip"))) return new Response(null, { status: 403 });

webhook() also takes timeoutMs / onTimeout (ack a slow update so telegram doesn't redeliver), onError ("fail" → 500 & redeliver, "ack" → 200 & drop), path + fallback (health checks), maxBodyBytes (streaming-enforced), and reply (answer the webhook request with an api call, saving a round trip).

diagnostics

import { getWebhookInfo, deleteWebhook } from "@yaebal/web";

const info = await getWebhookInfo(bot); // pending_update_count, last_error_message, …
await deleteWebhook(bot, { dropPendingUpdates: true }); // back to long polling

part of yaebal — a type-safe, runtime-agnostic Telegram Bot API framework. MIT.