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

@antmjs/warning

v2.3.27

Published

指定文件,在git commit提交的时候,将文件更改内容通知到微信、钉钉、飞书等聊天群或者发送到指定的邮箱

Downloads

117

Readme

@antmjs/warning

介绍

在 git commit 的时候,获取工作区和暂存区指定的文件 与最后一次提交成功的对比的结果

  • 实现通过微信、钉钉、飞书等聊天群机器人的 webhooks,通知群内成员对比的结果
  • 实现邮件发送,邮件通知到目标邮件对比结果

为什么需要

团队成员对项目关键的配置项、公用组件、公共方法修改了,需要通知开发组成员修改内容,避免影响开发的规范性和统一性

安装

使用前你需要确认安装 husky

yarn add @antmjs/warning -D

配置

  • 根目录配置 antm.config.ts(js)
  • 钉钉机器人配置的时候,安全设置需要设置为关键词“文件修改”,钉钉机器人的配置 emailReceiverswebhooks的配置支持数组和逗号隔开的字符串
module.exports = {
  warning: {
    monitorFiles: [
      'package.json',
      './packages/**/package.json', // 支持glob语法
    ],
    branchs: ['master'], // 监听的分支,不设置的话所有的分支都监听
    webhooks: {
      url: 'https://oapi.dingtalk.com/robot/send?access_token=xxx', // webhooks地址,多个用数组
    },
    email: {
      sender: '[email protected]', // 发送人
      senderPass: 'ASDFGHJASD', // 发送令牌,邮箱需要设置SMTP服务获取
      receivers: '[email protected]', // 接收人邮箱,多个用数组
    },
  },
}

命令行的使用

  • 在 husky 的脚本中触发
  • 命令行中可以配置相关配置
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
npx antm-warning webhooks
npx antm-warning email

antm-warning webhook 的相关参数

antm-warning webhooks:
  -u, --url, <url>                            set webhooks api of dingding | wechart | Lark | others, separated by commas
  -mf, --monitor-files, <monitorFiles>        set monitor files

antm-warning email 的相关参数

antm-warning email:
  -mf, --monitor-files, <monitorFiles>         set monitor files
  -sender, --sender, <sender>                  set the email sender
  -sender-pass, --sender-pass, <senderPass>    set the email sender pass
  -receivers, --receivers, <receivers>         set the email receivers, separated by commas