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

@kilnjs/telegram

v0.1.3

Published

Telegram messages for KilnJS, over the bot API and nothing else: no SDK and no dependency

Readme

@kilnjs/telegram

Telegram messages for KilnJS, as a module core is given rather than one it contains.

The bot API over fetch, and nothing else: no SDK and no dependency. Every method is a POST of JSON to a URL with the token in it, and a package that wraps that is a package to keep current for no reason.

Install

yarn add @kilnjs/telegram
import { telegram } from "@kilnjs/telegram";

export default {
  modules: [telegram()],
} satisfies AppConfig;
import { Telegram } from "@kilnjs/telegram";

await Telegram.send({ text: "Deploy finished", silent: true });

Settings

| | | | | --- | --- | --- | | token | TELEGRAM_BOT_TOKEN | required. Issued by BotFather, and the only credential there is | | chat | TELEGRAM_CHAT_ID | where a message goes when the call does not say | | parse | TELEGRAM_PARSE_MODE | HTML. Or MarkdownV2, or none | | api | TELEGRAM_API_URL | the bot API, overridable for a self-hosted one | | timeout | TELEGRAM_TIMEOUT_MS | 10000. How long a call may take before it is given up on: fetch has no limit of its own, and this sits on an alerting path | | driver | TELEGRAM_DRIVER | bot, and memory in a test run | | silent | TELEGRAM_SILENT | false. Delivered without a notification | | preview | TELEGRAM_PREVIEW | false. Whether a link in the text unfurls | | protect | TELEGRAM_PROTECT | false. Whether a message may be forwarded or saved | | thread | TELEGRAM_THREAD_ID | the topic inside a forum group | | retries | TELEGRAM_RETRIES | 0. Attempts after a call that did not arrive | | retryDelay | TELEGRAM_RETRY_DELAY_MS | 500, doubling after each attempt |

A message with no chat in the call and no default configured is refused here rather than sent to whichever chat happened to be last.

Every per-message field has a default here, and a call still overrides it: silent, preview, protect, thread and parse are declared once for a server whose messages are all alerts, and named in the call where one is not.

Retries are off unless something asks for them. A message Telegram read and refused is refused again, so only a call that never arrived, a 429 and a 5xx are sent a second time.

What it gets right

ok: false is a failure. Telegram answers a refused message with HTTP 200 and ok: false, and a client that only checked the status would report success. Both are checked, and the description Telegram gave is what reaches the log.

Link previews are off. An alert that unfurls a link is an alert with somebody else's image in it. Pass preview: true in the call, or declare it once in telegram({ preview: true }).

A test run sends nothing. Every message is recorded instead, and sentMessages() is what a suite asserts against. No token is needed for that, and none is reached. driver: "memory" is the same thing anywhere else, for a staging deployment that should not message a real chat.

Beyond a message

Telegram.call(method, payload) is the whole bot API, for the hundred methods this package does not wrap:

await Telegram.call("sendDocument", { chat_id: chat, document: url });

It is not recorded in a test run, because what it does is not known here: a suite that calls it is asking for the call to happen.

Development

yarn verify   # ts:check, lint, build, exports:check, test