{"id":22362677,"url":"https://github.com/alonelucky/pm2-notify-x","last_synced_at":"2025-10-09T00:20:30.982Z","repository":{"id":57326331,"uuid":"217183784","full_name":"alonelucky/pm2-notify-x","owner":"alonelucky","description":"当前项目是一个pm2的进程通知插件模块","archived":false,"fork":false,"pushed_at":"2024-05-20T01:15:23.000Z","size":2105,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T01:42:43.275Z","etag":null,"topics":["bark","bot","dingtalk","feishu","notify","pm2","process","slack","telegram","wxwork"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alonelucky.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-24T01:17:11.000Z","updated_at":"2024-05-20T01:15:26.000Z","dependencies_parsed_at":"2025-07-30T14:35:12.313Z","dependency_job_id":null,"html_url":"https://github.com/alonelucky/pm2-notify-x","commit_stats":null,"previous_names":["xiaqiubo/pm2-notify-x"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alonelucky/pm2-notify-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alonelucky%2Fpm2-notify-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alonelucky%2Fpm2-notify-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alonelucky%2Fpm2-notify-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alonelucky%2Fpm2-notify-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alonelucky","download_url":"https://codeload.github.com/alonelucky/pm2-notify-x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alonelucky%2Fpm2-notify-x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000718,"owners_count":26082879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bark","bot","dingtalk","feishu","notify","pm2","process","slack","telegram","wxwork"],"created_at":"2024-12-04T17:10:16.324Z","updated_at":"2025-10-09T00:20:30.966Z","avatar_url":"https://github.com/alonelucky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pm2-notify-x\r\n\r\n\u003e 当前项目是一个pm2的进程通知插件模块\r\n\u003e 借助已有途径对 pm2 进程错误信息实时提醒\r\n\r\n### 1. 安装使用\r\n```bash \r\npm2 install pm2-notify-x\r\n```\r\n\r\n### 2. 完整配置\r\n```json\r\n{\r\n    \"delay\": 15,            // pm2 set pm2-notify-x:delay 15\r\n    \"debug\": false,         // pm2 set pm2-notify-x:debug false\r\n    \"smtp\": \"\",             // 利用url解析smtp配置,协议s为开启 tls; pm2 set pm2-notify-x:smtp smtp://username:password@smtp.163.com:25\r\n    \"wxwork\": [],           // 支持多个设置 `,` 分割 pm2 set pm2-notify-x:wxwork uuidkey\r\n    \"email\": [],             // 支持多个设置 `,` 分割 pm2 set pm2-notify-x:email email\r\n    \"bark\": [],\r\n    \"slack\": [],\r\n    \"dingtalk\": [],\r\n    \"feishu\": [],\r\n    \"telegram\": [],\r\n    \"process_wxwork\": [],   // pm2 set pm2-notify-x:process_wxwork\r\n    \"process_feishu\": [],   // pm2 set pm2-notify-x:process_feishu\r\n    \"process_email\": [],     // pm2 set pm2-notify-x:process_email\r\n    ...\r\n}\r\n```\r\n\r\n### 3. 项目规划\r\n\r\n- [x] 企业微信 `wxwork` [文档](https://developer.work.weixin.qq.com/document/path/91770)\r\n- [x] Bark通知 `bark` [文档](https://bark.day.app/#/tutorial?id=url%e6%a0%bc%e5%bc%8f)\r\n- [x] Slack通知 `slack` [文档](https://api.slack.com/reference/surfaces/formatting#attachments)\r\n- [x] Telegram通知 `telegram` [文档](https://core.telegram.org/bots/api#formatting-options)\r\n- [x] 钉钉通知 `dingtalk` [文档](https://open.dingtalk.com/document/orgapp/custom-bot-send-message-type#)\r\n- [x] 飞书通知 `feishu` [文档](https://open.feishu.cn/document/common-capabilities/message-card/message-cards-content/card-structure/card-content)\r\n- [x] SMTP 邮件通知 `email` [文档](https://nodemailer.com/)\r\n- [x] 按进程区分通知\r\n- [x] 增加消息规则匹配\r\n\r\n### 4. 使用示例\r\n\r\n```\r\n$\u003e pm2 l\r\n┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐\r\n│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │\r\n├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤\r\n│ 4  │ test               │ fork     │ 378  │ online    │ 0%       │ 0b       │\r\n│ 9  │ test               │ fork     │ 64   │ online    │ 0%       │ 0b       │\r\n│ 6  │ test111            │ fork     │ 15   │ online    │ 0%       │ 0b       │\r\n└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘\r\n```\r\n- 全局配置\r\n```bash\r\n# 合并通知间隔: 单位秒, 默认 15s\r\n$\u003e pm2 set pm2-notify-x:delay 15\r\n# 设置调试日志输出\r\n$\u003e pm2 set pm2-notify-x:debug true\r\n# 设置日志匹配规则\r\n# 增加 jsonpath 查找，查找规则 https://radash-docs.vercel.app/docs/object/get，查不到依然通知，只不过通知的是消息整体\r\npm2 set pm2-notify-x:find $.msg\r\n# 增加正则查找，正则支持 正则表达式及字符串, 正则表达式匹配不到的消息不进行通知\r\npm2 set pm2-notify-x:find /\"msg\":/ig    # will eval('/\"msg\":/ig')\r\npm2 set pm2-notify-x:find \"msg\":        # will new Regexp('\"msg\":')\r\n```\r\n\r\n- 设置企微通知\r\n```bash\r\n$\u003e pm2 set pm2-notify-x:wxwrok uuidkey\r\n\r\n# 为 test 程序设置企微通知\r\n$\u003e pm2 set pm2-notify-x:test_wxwrok uuidkey\r\n```\r\n\r\n- 设置Slack通知\r\n```bash\r\n# 为 test111 程序设置企微通知\r\n$\u003e pm2 set pm2-notify-x:test111_slack slackurl\r\n```\r\n\r\n- 设置 telegram 通知\r\n```bash\r\n# 为 test111 程序设置指定解析匹配通知\r\n$\u003e pm2 set pm2-notify-x:test111_telegram tgboturl\r\n$\u003e pm2 set pm2-notify-x:test111_find $.msg\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falonelucky%2Fpm2-notify-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falonelucky%2Fpm2-notify-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falonelucky%2Fpm2-notify-x/lists"}