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/toml

v0.1.2

Published

yaebal toml — declarative toml routes for yaebal bots.

Readme

@yaebal/toml

declarative toml routes for yaebal bots.

status: experimental.

installation

pnpm add @yaebal/toml

what it is

@yaebal/toml lets small bots describe commands, text routes, message filters, callback queries, and simple replies in toml. typescript stays available for real logic through a handler registry.

bot.toml

[[commands]]
name = "start"
description = "say hello"
reply = "привет! я бот из toml."

[[commands]]
name = "ping"
description = "check the bot is alive"
handler = "ping"

[[hears]]
regex = "^p[io]ng$"
reply = "pong"

[[messages]]
on = "message:text"
contains = "yaebal"
reply = "yaebal мощь"

[[callbacks]]
data = "profile"
handler = "profileCallback"

every route needs reply = "..." or handler = "name". hears takes exactly one of text (exact match) or regex; callbacks takes exactly one of data or regex. messages filters by an on filter query (validated against the real update names at install time) plus optional contains / equals text filters.

index.ts

import { Bot } from "@yaebal/core";
import { installToml } from "@yaebal/toml";

const bot = new Bot(process.env.BOT_TOKEN!);

installToml(bot, "./bot.toml", {
	syncCommands: true,
	handlers: {
		ping: async (ctx) => {
			await ctx.reply("pong from typescript");
		},
		profileCallback: async (ctx) => {
			await ctx.reply("profile");
		},
	},
});

await bot.start();

installToml accepts a file path, a raw toml string, or an already parsed object, and returns the same bot or composer instance. the whole config is validated before any route is registered, so a bad config can never leave the bot half-wired.

command menu

with syncCommands: true, commands that have a description are pushed to the telegram command menu (setMyCommands) once the bot starts. commands without a description are still routed — they just stay out of the menu. syncCommands needs a Bot target (it hooks onStart); installing on a plain Composer fails with a readable error.

handler registry

when a route uses handler = "name", the name must exist in options.handlers. if a handler is missing, install fails before any route is registered:

Missing handler "ping" referenced in commands[1]

if both handler and reply are present, the handler wins. the reply is only used when no handler is configured.

callback routes that use reply also answer the callback query first, so the button never hangs on a spinner. handler-based callback routes answer it themselves (ctx.answerCallbackQuery()).

plugin usage

import { createTomlPlugin } from "@yaebal/toml";

bot.install(createTomlPlugin("./bot.toml", { handlers }));

limitations

toml does not replace typescript logic. it only describes routes and simple replies. use the handler registry for validation, database calls, external services, branching flows, and anything that needs compile-time types.


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