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

notify-dingtalk

v1.2.0

Published

钉钉群 Markdown 消息通知。

Downloads

12

Readme

notify-dingtalk

钉钉群 Markdown 消息通知。

安装

npm i notify-dingtalk -D

国内推荐使用 tbify 加速。

使用

在项目根目录创建配置文件 notify-dingtalk.config.js,然后导出配置即可:

const { defineConfig } = require('notify-dingtalk')

module.exports = defineConfig({
  accessToken: 'xxx',
  secret: 'xxx',
  title: '发布通知',
  content: '**优化**: 添加属性',
})

如果要通知到多个群,导出一个数组即可:

const { defineConfig } = require('notify-dingtalk')

module.exports = [
  defineConfig({
    accessToken: 'xxx',
    secret: 'xxx',
    title: '发布通知',
    content: '**优化**: 添加属性',
  }),
  defineConfig({
    accessToken: 'xxx2',
    secret: 'xxx2',
    title: '发布通知',
    content: '**优化**: 添加属性',
  }),
]

其中 accessTokensecret 也可以不用显式指定,而是分别通过环境变量 D_ACCESS_TOKEND_SECRET 设置。

最后,执行以下命令发送通知到钉钉群:

npx notify-dingtalk

效果如下:

一个更符合实际项目的示例

如果你的更新日志是采用 conventional-changelog 生成的,可使用包提供的 getLatestConventionalChangelog 方法获取最新的更新日志。

const {
  defineConfig,
  getLatestConventionalChangelog,
} = require('notify-dingtalk')
const { dedent } = require('vtils')

module.exports = defineConfig({
  accessToken: '******',
  secret: '******',
  title: '发布公告',
  content: dedent`
    # 发布公告

    ---

    ${getLatestConventionalChangelog('./CHANGELOG.md')}

    ---

    [进入主页→](https://github.com/fjc0k/notify-dingtalk)
  `,
})

许可

MIT (c) Jay Fong