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 🙏

© 2024 – Pkg Stats / Ryan Hefner

pm2-notify-x

v1.4.0

Published

PM2 notify module

Downloads

20

Readme

pm2-notify-x

当前项目是一个pm2的进程通知插件模块 借助已有途径对 pm2 进程错误信息实时提醒

1. 安装使用

pm2 install pm2-notify-x

2. 完整配置

{
    "delay": 15,            // pm2 set pm2-notify-x:delay 15
    "debug": false,         // pm2 set pm2-notify-x:debug false
    "smtp": "",             // 利用url解析smtp配置,协议s为开启 tls; pm2 set pm2-notify-x:smtp smtp://username:[email protected]:25
    "wxwork": [],           // 支持多个设置 `,` 分割 pm2 set pm2-notify-x:wxwork uuidkey
    "email": [],             // 支持多个设置 `,` 分割 pm2 set pm2-notify-x:email email
    "bark": [],
    "slack": [],
    "dingtalk": [],
    "feishu": [],
    "telegram": [],
    "process_wxwork": [],   // pm2 set pm2-notify-x:process_wxwork
    "process_feishu": [],   // pm2 set pm2-notify-x:process_feishu
    "process_email": [],     // pm2 set pm2-notify-x:process_email
    ...
}

3. 项目规划

  • [x] 企业微信 wxwork 文档
  • [x] Bark通知 bark 文档
  • [x] Slack通知 slack 文档
  • [x] Telegram通知 telegram 文档
  • [x] 钉钉通知 dingtalk 文档
  • [x] 飞书通知 feishu 文档
  • [x] SMTP 邮件通知 email 文档
  • [x] 按进程区分通知
  • [x] 增加消息规则匹配

4. 使用示例

$> pm2 l
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 4  │ test               │ fork     │ 378  │ online    │ 0%       │ 0b       │
│ 9  │ test               │ fork     │ 64   │ online    │ 0%       │ 0b       │
│ 6  │ test111            │ fork     │ 15   │ online    │ 0%       │ 0b       │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
  • 全局配置
# 合并通知间隔: 单位秒, 默认 15s
$> pm2 set pm2-notify-x:delay 15
# 设置调试日志输出
$> pm2 set pm2-notify-x:debug true
# 设置日志匹配规则
# 增加 jsonpath 查找,查找规则 https://radash-docs.vercel.app/docs/object/get,查不到依然通知,只不过通知的是消息整体
pm2 set pm2-notify-x:find $.msg
# 增加正则查找,正则支持 正则表达式及字符串, 正则表达式匹配不到的消息不进行通知
pm2 set pm2-notify-x:find /"msg":/ig    # will eval('/"msg":/ig')
pm2 set pm2-notify-x:find "msg":        # will new Regexp('"msg":')
  • 设置企微通知
$> pm2 set pm2-notify-x:wxwrok uuidkey

# 为 test 程序设置企微通知
$> pm2 set pm2-notify-x:test_wxwrok uuidkey
  • 设置Slack通知
# 为 test111 程序设置企微通知
$> pm2 set pm2-notify-x:test111_slack slackurl
  • 设置 telegram 通知
# 为 test111 程序设置指定解析匹配通知
$> pm2 set pm2-notify-x:test111_telegram tgboturl
$> pm2 set pm2-notify-x:test111_find $.msg