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

@emito/provider-telegram

v0.1.0

Published

Telegram provider plugin for Emito.

Readme

@emito/provider-telegram

Telegram Bot API provider plugin for Emito notification delivery.

License Types

TypeScript

What it is

@emito/provider-telegram is a delivery provider plugin that sends notifications through the Telegram Bot API. It implements the ProviderPlugin contract from @emito/types for the telegram channel, posting each message to the bot's sendMessage endpoint with parse_mode: "HTML".

Providers are deliberately thin. They translate a channel's delivery params into one upstream API call and map transport failures to Emito's typed EmitoError codes, so the core engine can decide what to retry and what to drop.

Install

@emito/provider-telegram is a workspace package in the Emito monorepo and is not yet published to npm. Inside the monorepo, depend on it with the workspace protocol:

// package.json
{
  "dependencies": {
    "@emito/provider-telegram": "workspace:*"
  }
}

The package depends on @emito/types for the shared provider and delivery contracts, which resolves through the workspace. It has no other runtime dependencies and uses the platform fetch. Standalone publishing to npm is planned.

Usage

createTelegramProvider() returns a ProviderPlugin that you register with the Emito send pipeline. Delivery params follow the TelegramDeliveryParams shape from @emito/types.

import { createTelegramProvider } from "@emito/provider-telegram";

const provider = createTelegramProvider();

const result = await provider.deliver({
  channel: "telegram",
  botToken: process.env.TELEGRAM_BOT_TOKEN!,
  chatId: "123456789",
  html: "<b>Build passed</b> — deploy is live.",
  metadata: {
    notificationId: "ntf_123",
    subscriberId: "sub_456",
    eventType: "deploy.succeeded",
  },
});

if (result.success) {
  // message accepted by Telegram
}

To inject a custom HTTP client (for testing, proxying, or instrumentation), pass your own fetch implementation:

const provider = createTelegramProvider({ fetchFn: myFetch });

Every request carries a 10 second deadline so a stalled API call cannot hold a delivery worker open indefinitely. Override it with timeoutMs:

const provider = createTelegramProvider({ timeoutMs: 3_000 });

API surface

| Export | Kind | Description | | --- | --- | --- | | createTelegramProvider(options?) | function | Builds a ProviderPlugin for the telegram channel. | | options.fetchFn | typeof fetch | Optional. Custom fetch used for the API call. Defaults to globalThis.fetch. | | options.timeoutMs | number | Optional. Per-request deadline. Defaults to 10_000. |

The returned ProviderPlugin:

| Member | Type | Description | | --- | --- | --- | | name | "telegram" | Provider identifier. | | channel | "telegram" | Channel this provider serves. | | deliver(params) | Promise<DeliveryResult> | Sends the message; resolves { success: true } on success, throws a typed EmitoError on failure. | | healthCheck() | Promise<boolean> | Returns true. |

Error mapping

deliver translates Telegram HTTP responses into EmitoError instances with the appropriate EMITO_ERROR_CODE and retry classification:

| HTTP status | Error code | Retryable | | --- | --- | --- | | 429 | RATE_LIMITED | yes | | 403 (bot blocked by user) | DELIVERY_SPAM_COMPLAINT | no | | 404 | DELIVERY_INVALID_ADDRESS | no | | >= 500 | PROVIDER_UNAVAILABLE | yes | | other non-OK | DELIVERY_REJECTED | no |

A request that exceeds the deadline becomes a retryable PROVIDER_TIMEOUT. Other network or unexpected errors are wrapped as PROVIDER_UNAVAILABLE and marked retryable.

Part of Emito

@emito/provider-telegram is one package in the Emito monorepo — self-hosted, provider-agnostic notification infrastructure for Node.js and TypeScript.

License

MIT — part of the Emito project.