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

node-dingding-push

v1.0.5

Published

钉钉推送

Downloads

2

Readme

Node钉钉推送

当前v1.0.0仅支持:

  1. 纯文本
  2. Link跳转
  3. 钉钉支持的markdown(Tips: https://open-doc.dingtalk.com/microapp/serverapi2/qf2nxq)

具体参数如何配置,详细的说明,具体参考“钉钉文档链接”,链接同上👆。


/**
 * 参数说明
 * 
 * @param webhookUrl, // 机器人webhookUrl
 * @param secret, // 机器人secret
 * @param msg, // 推送内容
 * @param msgtype = 'text', // text- 纯文本, markdown- .md格式, link- 链接
 * @param title = '', // 消息标题
 * @param picUrl = '', // 图片URL
 * @param messageUrl = '', // 点击消息跳转的URL
 *
 */

可调用方法 run(type) // type: 0- 推送但不at任何人, 1- 推送并且at全体群员, 2- 推送并且at指定群员工

Demo: (Text类型),功能:推送消息并且at指定人员(需知道对方钉钉绑定的手机号)

// const DingdingBot = require('node-dingding-push').default

import  DingdingBot from 'node-dingding-push'

const curDate = new Date()
const dd = new DingdingBot({
  webhookUrl: 'your_webhookUrl',
  secret: 'your_secret',
  msgtype: 'text',
  msg: '偷偷@一下部门里的其他同事😏',
  atMobiles: ['同事A的手机号', '同事B的手机号']
})
dd.run(2)

Demo: (Link类型),功能:推送消息(可点击跳转到详情链接)

// const DingdingBot = require('node-dingding-push').default

import  DingdingBot from 'node-dingding-push'

const curDate = new Date()
const dd = new DingdingBot({
  webhookUrl: 'your_webhookUrl',
  secret: 'your_secret',
  msgtype: 'link', 
  title: '测试标题',
  picUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1577114596765&di=e45e353bbe693a5cbb51215b47fad2dc&imgtype=0&src=http%3A%2F%2Fimg3.tbcdn.cn%2Ftfscom%2Fi2%2F101742512%2FTB2x7C0nFXXXXbsXpXXXXXXXXXX_%2521%2521101742512.jpg',
  messageUrl: 'https://www.dingtalk.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI',
  msg: '走,咱们跳详情页去☁️'
})
dd.run(1)

Demo: (MarkDown类型),功能:推送MarkDown格式消息

// const DingdingBot = require('node-dingding-push').default

import  DingdingBot from 'node-dingding-push'

const curDate = new Date()
const dd = new DingdingBot({
  webhookUrl: 'your_webhookUrl',
  secret: 'your_secret',
  msgtype: 'markdown',
  title: '测试标题',
  msg:  `> “<font color=#FF0000>测试</font>环境\n\n` + 
  `> 更新内容为:测试测试测试...” \n` + 
  `> ###### ${curDate.getHours()}点${curDate.getMinutes()}分${curDate.getSeconds()}秒发布 \n`
})
dd.run(1)