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 🙏

© 2025 – Pkg Stats / Ryan Hefner

pm2-telegram-notification

v0.4.0

Published

Update pm2 Status in Telegram

Readme

Bot API npm package Build Status Contributors Forks Stargazers Issues MIT License

What is pm2-telegram-notification ?

Send server logs to a telegram group/chat. works with pm2 process manager.

Installation

pm2 install pm2-telegram-notification

How to Use

Telegram setup

  • create a telegram bot link
  • add that bot to a group if you want to send logs to a group
  • get chat_id
    • to get chat_id use https://api.telegram.org/bot<BOT_TOKEN>/getUpdates api

pm2-telegram-notification setup

  • install pm2-telegram-notification -- pm2 install pm2-telegram-notification
  • configure bot token -- pm2 set pm2-telegram-notification:bot_token BOT_TOKEN
  • configure chat id -- pm2 set pm2-telegram-notification:chat_id CHAT_ID
    • if its a group chat id append g-

      eg:

      group chat CHAT_ID = 123456 -> g-123456

      personal chat CHAT_ID = 123456 -> 123456

  • configure server name (optional) --pm2 set pm2-telegram-notification:server_name SERVER_NAME
  • configure lifecycle (optional) default: true --pm2 set pm2-telegram-notification:lifecycle (true/false)
  • configure error (optional) default: true --pm2 set pm2-telegram-notification:error (true/false)
  • configure error_log (optional) default: true --pm2 set pm2-telegram-notification:error_log (true/false)
Configuration definition 😎
  • server_name = name of the server
  • bot_token = token generated with telegram as suggested in 'Telegram setup section'
  • chat_id = identifier corresponding to particular group or personal chat on which the notifications are expected to be posted, as explained in 'Telegram setup section'
  • lifecycle = enabled alerts for lifecycle event handlers exposed by pm2, default is true
  • error = enabled alerts for error handlers exposed by pm2, default is true
  • error_log = flag configuration to truncate log with ref-id above 3500 characters with a trace in logs annotated with that ref-id, default is true
  • violation_time = time interval gap in which if another alerts occurs is said to count as violation, default is 10000
  • violation_count = violation count limit after which the notification is delayed with debounce time, default is 8
  • debounce = delay/debounce time applied in milliseconds to notification in case if violation count limit is reached, default is 30000