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

telegram_notification

v1.0.6

Published

This package will be used to send notification on Telegram whenever we get error in our application.

Downloads

103

Readme

Telegram Notification Sender

Description:

Telegram Notification Sender is a lightweight Node.js module designed to easily send notifications to a Telegram channel or group using the Telegram Bot API. Simply set up your environment variables with your bot token and channel ID, and start sending messages programmatically. Perfect for automated notifications, alerts, or updates from your applications.

This package provides a simple API to interact with the Telegram Bot API, handles error logging, and returns useful status codes to ensure your messages are delivered successfully.

Features

  • Sends notifications to a specified Telegram channel or group.
  • Utilizes the Telegram Bot API for message delivery.
  • Handles basic error logging and response handling.

Installation

You can install this package via npm:

npm install telegram_notification

Environment Variables

Make sure to set the following environment variables in your .env file:

TELEGRAM_BOT_TOKEN=your_telegram_bot_token
CHANNEL_ID=your_channel_or_group_id
  • TELEGRAM_BOT_TOKEN: The token for your Telegram bot, provided by BotFather.
  • CHANNEL_ID: The ID of the Telegram channel or group where you want to send the message.

Usage

Here is a basic example of how to use the package:

Common Js Module

const { sendTelegramNotification } = require('telegram_notification');

const message = "Hello, this is a test notification!";

sendTelegramNotification(message)
  .then(response => {
    console.log(response);  // { statusCode: 200, message: 'Message has been sent successfully' }
  })
  .catch(error => {
    console.error(error);   // Handle any error here
  });

Es6 Module

import { sendTelegramNotification } from ('telegram_notification');

const message = "Hello, this is a test notification!";

sendTelegramNotification(message)
  .then(response => {
    console.log(response);  // { statusCode: 200, message: 'Message has been sent successfully' }
  })
  .catch(error => {
    console.error(error);   // Handle any error here
  });

Functions

sendTelegramNotification(message)

Sends a notification message to the configured Telegram channel.

  • message: The message text to send (default message is used if none is provided).

Response:

  • On success: { statusCode: 200, message: 'Message has been sent successfully' }
  • On failure: { statusCode: <error code>, message: <error message> }

Error Handling

If the Telegram Bot Token or Channel ID is missing from the environment variables, the function will throw an error during initialization.

Example Error:

Error: TELEGRAM_BOT_TOKEN is missing in .env

License

MIT License.