A minimal PM2 utility to send real-time crash and restart alerts to Telegram via a bot. Stay informed when your Node.js app fails or restarts unexpectedly.
npm install pm2-telewatch.env-based config or use CLI arguments
bash
npm install pm2-telewatch
`
`
āļø Setup
1. Create a Telegram Bot
Chat with @BotFather
Send /newbot, follow prompts
Save the generated bot token
`
`
2. Get Your Chat ID
Start a chat with your bot by sending /start
`
`
š Configuration
Before using pm2-telewatch, set up your environment variables.
ā
Create a .env file in your project:
BOT_TOKEN=123456789:ABCdefGhIJKLmnoPQRstuvWXyz12345678
PM2_APP_NAME=my-app # Optional: monitor only this app.
`
`
ā¶ļø Usage
Once your environment variables are set, just import the module:
const teleWatch = require("pm2-telewatch"); // auto-starts on import
`
---
---
---
ā
You're all set!
pm2-telewatch` is now watching your PM2 processes.