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

npm-feishu-notifier

v1.0.4

Published

A CLI tool to send npm publish notifications to Feishu.

Readme

npm-feishu-notifier

一个轻量级、零配置的 CLI 工具,旨在连接您的 npm publish 工作流与飞书,通过自动化校验和通知,提升发布质量和团队同步效率。

核心愿景

本工具旨在成为您 npm 发布流程的“守门员”。在发布前,它会执行一系列校验,确保您的软件包处于良好状态。成功发布后,它会自动向指定的飞书群组发送一条格式精美的消息卡片。

功能特性

  • 自动化发布通知:npm publish 成功后,自动发送飞书消息卡片,包含包名、版本、发布者和更新日志等信息。
  • 发布前校验: 在不满足预设条件时阻止发布:
    • Git 状态: 确保工作区是干净的,并且您位于主干分支上。
    • 更新日志: 检查 CHANGELOG.md 是否存在,并且包含了新版本的条目。
    • 版本: 验证当前版本尚未发布到 npm registry。
    • 配置: 检查飞书机器人的 URL是否已配置。
  • 灵活配置: 可通过 package.json 中的 feishuNotifier 字段或独立的 .notifierrc.json 文件进行配置。
  • 简单易用:
    • 提供 init 命令,可快速设置您的项目。
    • 提供 --dry-run 模式,用于测试通知功能,而无需实际发送。

安装

npm install npm-feishu-notifier --save-dev

使用方法

1. 初始化

运行 init 命令,它将自动配置您的 package.json

npx npm-feishu-notifier init

该命令会向您的 package.json 添加以下内容:

{
  "scripts": {
    "prepublishOnly": "npm-feishu-notifier validate",
    "postpublish": "npm-feishu-notifier notify"
  },
  "feishuNotifier": {
    "feishuBotUrl": "https://open.feishu.cn/open-apis/bot/v2/hook/YOUR_WEBHOOK_ID",
    "changelogPath": "CHANGELOG.md",
    "check": {
      "version": true,
      "changelog": true,
      "git": true
    },
    "mainBranch": "main"
  }
}

重要提示: 您必须将 YOUR_WEBHOOK_ID 替换为您真实的飞书机器人 Webhook 地址。

2. 发布流程

配置完成后,您的工作流程将非常简单:

  1. 更新 package.json 中的 version 字段。
  2. CHANGELOG.md 中为新版本添加对应的条目 (例如, ## [1.2.3])。
  3. 提交您的代码变更。
  4. 运行 npm publish

prepublishOnlypostpublish 脚本会自动触发校验和通知步骤。

命令列表

  • npm-feishu-notifier init: 初始化配置。
  • npm-feishu-notifier validate: 执行发布前校验。
  • npm-feishu-notifier notify: 发送飞书通知。
    • --dry-run: 在控制台打印通知内容,而不实际发送。

飞书消息卡片示例

飞书消息卡片示例