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

@o25.16pm.0510/multi-notify

v1.260513.11916

Published

CLI gửi thông báo đa kênh; kênh nào đủ cấu hình .env thì gửi, thiếu thì tự bỏ qua.

Readme

Multi Env Notify CLI

CLI gửi thông báo đa kênh theo nguyên tắc:

Kênh nào đủ cấu hình .env thì gửi. Kênh nào thiếu cấu hình thì tự bỏ qua.

Bản này được cấu trúc theo hướng dễ public lên npmjs: không cần build TypeScript, chạy trực tiếp bằng Node.js ESM, có bin command.

Kênh hỗ trợ

  • Telegram: nhiều bot, nhiều group/chat, topic/thread.
  • Email SMTP: một hoặc nhiều cấu hình SMTP.
  • Slack Incoming Webhook.
  • Discord Incoming Webhook.
  • Twilio SMS.
  • ntfy HTTP publish.
  • Generic Webhook.

Cài đặt dev

npm run install
cp .env.example .env
npm run dev -- --title "Test" --message "Xin chào" --level success

Chạy CLI

node bin/multi-notify.js --title "Deploy OK" --message "Production đã deploy xong" --level success

Sau khi publish npm:

npx multi-env-notify-cli --title "Deploy OK" --message "Production đã deploy xong" --level success

Hoặc cài global:

npm i -g multi-env-notify-cli
multi-notify --title "Hello" --message "Tin nhắn từ CLI"

Quy tắc Telegram

1 bot gửi 1 group/chat

MULTI_NOTIFY_TELEGRAM_BOT_TOKEN=123456:ABC
MULTI_NOTIFY_TELEGRAM_CHAT_ID=-1001111111111
MULTI_NOTIFY_TELEGRAM_PARSE_MODE=HTML

1 bot gửi nhiều group/chat

MULTI_NOTIFY_TELEGRAM_BOT_TOKEN=123456:ABC

MULTI_NOTIFY_TELEGRAM_CHAT_ID_1=-1001111111111
MULTI_NOTIFY_TELEGRAM_CHAT_ID_1_NAME=ops-group

MULTI_NOTIFY_TELEGRAM_CHAT_ID_2=-1002222222222
MULTI_NOTIFY_TELEGRAM_CHAT_ID_2_NAME=dev-group

Nhiều bot, mỗi bot gửi nhiều group/chat

MULTI_NOTIFY_TELEGRAM_BOT_1_NAME=ops-bot
MULTI_NOTIFY_TELEGRAM_BOT_1_TOKEN=111111:AAA
MULTI_NOTIFY_TELEGRAM_BOT_1_CHAT_ID_1=-1001111111111
MULTI_NOTIFY_TELEGRAM_BOT_1_CHAT_ID_1_NAME=ops-group
MULTI_NOTIFY_TELEGRAM_BOT_1_CHAT_ID_2=-1002222222222
MULTI_NOTIFY_TELEGRAM_BOT_1_CHAT_ID_2_NAME=dev-group

MULTI_NOTIFY_TELEGRAM_BOT_2_NAME=business-bot
MULTI_NOTIFY_TELEGRAM_BOT_2_TOKEN=222222:BBB
MULTI_NOTIFY_TELEGRAM_BOT_2_CHAT_ID_1=-1003333333333
MULTI_NOTIFY_TELEGRAM_BOT_2_CHAT_ID_1_NAME=business-group

Gửi vào topic/forum của Telegram group

MULTI_NOTIFY_TELEGRAM_BOT_1_TOKEN=111111:AAA
MULTI_NOTIFY_TELEGRAM_BOT_1_CHAT_ID_1=-1001111111111
MULTI_NOTIFY_TELEGRAM_BOT_1_CHAT_ID_1_THREAD_ID=12345

Dạng danh sách nhanh

MULTI_NOTIFY_TELEGRAM_BOT_3_TOKEN=333333:CCC
MULTI_NOTIFY_TELEGRAM_BOT_3_CHAT_IDS=-1001111111111,-1002222222222

ntfy

Cấu hình tối thiểu:

MULTI_NOTIFY_NTFY_TOPIC=my-alert-topic

Tùy chọn:

MULTI_NOTIFY_NTFY_SERVER_URL=https://ntfy.sh
MULTI_NOTIFY_NTFY_TOKEN=
MULTI_NOTIFY_NTFY_PRIORITY=default
MULTI_NOTIFY_NTFY_TAGS=warning,computer
MULTI_NOTIFY_NTFY_CLICK_URL=https://example.com

Có thể gửi riêng ntfy:

multi-notify --only ntfy --title "Test" --message "Xin chào ntfy"

CLI options

multi-notify \
  --title "Cảnh báo" \
  --message "Dung lượng ổ đĩa vượt 90%" \
  --level warning \
  --meta server=prod-01 \
  --meta disk=92%

| Option | Mô tả | | ----------------------- | ---------------------------------------------- | | --title | Tiêu đề tin nhắn | | --message | Nội dung tin nhắn | | --level | debug, info, success, warning, error | | --meta key=value | Thêm metadata, dùng được nhiều lần | | --env-file .env.prod | Load file env tùy chọn | | --json | In kết quả dạng JSON | | --only telegram,slack | Chỉ gửi một số provider | | --dry-run | Chỉ hiển thị target sẽ gửi, không gửi thật | | --list-targets | Liệt kê target đang detect được từ env |

Kiểm tra target trước khi gửi

multi-notify --list-targets

Chỉ kiểm tra Telegram:

multi-notify --only telegram --list-targets

Dry-run:

multi-notify --only telegram --dry-run --title "Test" --message "Không gửi thật"

Publish npm

  1. Sửa name trong package.json nếu tên multi-env-notify-cli đã bị dùng.
  2. Login npm:
npm login
  1. Kiểm tra gói publish:
npm pack --dry-run
  1. Publish:
npm publish --access public

Bảo mật

  • Không commit .env.
  • Không đưa token thật vào README, test, fixture hoặc .env.example.
  • Token Telegram/Twilio/Slack/Discord nếu lộ phải rotate ngay.