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

push-all-in-one

v3.5.1

Published

Push All In One!支持 Server酱、自定义邮件、钉钉机器人、企业微信机器人、企业微信应用、pushplus、iGot 、Qmsg、息知、PushDeer、Discord、OneBot、Telegram 等多种推送方式

Downloads

940

Readme

Push All In One!支持 Server 酱、自定义邮件、钉钉机器人、企业微信机器人、企业微信应用、pushplus、iGot 、Qmsg、息知、PushDeer、Discord、OneBot、Telegram 等多种推送方式。

温馨提示:出于安全考虑, 所有 推送方式请在 服务端 使用!请勿在 客户端(网页端) 使用!网页端使用还将额外产生跨域问题。

《草梅定时推送》第二次内测公告 电脑端访问地址:https://push.cmyr.ltd/ 手机端访问地址:https://push-mp.cmyr.ltd/ APP 端访问地址:https://uni-admin.cmyr.ltd/app/timing-push-mp 本网站主要功能为基于 push-all-in-one 开发的定时推送功能。 本次内测为删档内测,草梅友仁不保证数据在后续内测可以保留。但可能会提供数据导出方案。 本次内测为长期测试,暂无结束时间。具体结束日期可等待后续公告。 内测期间草梅友仁可能会多次重启后台服务器,因此可能会造成部分数据缺失,如遇到该问题请联系草梅友仁。 新用户建议阅读文档后开始使用 交流群:807530287 问题反馈地址:https://support.qq.com/products/621054 2024 年 01 月 26 日

🏠 主页

https://github.com/CaoMeiYouRen/push-all-in-one#readme

✨ Demo

https://github.com/CaoMeiYouRen/push-all-in-one/tree/master/examples

📦 依赖要求

  • node >=12

🚀 安装

npm i push-all-in-one -S

👨‍💻 使用

import { ServerChanTurbo, CustomEmail, Dingtalk, WechatRobot, WechatApp, PushPlus, IGot, Qmsg, XiZhi, PushDeer, Discord, OneBot, Telegram } from 'push-all-in-one'

// Server酱。官方文档:https://sct.ftqq.com/
const SCTKEY = 'SCTxxxxxxxxxxxxxxxxxxx'
const serverChanTurbo = new ServerChanTurbo(SCTKEY)
serverChanTurbo.send('你好', '你好,我很可爱')

// 【推荐】自定义邮件,基于 nodemailer 实现,官方文档: https://github.com/nodemailer/nodemailer
const customEmail = new CustomEmail({
    EMAIL_TYPE: 'text',
    EMAIL_TO_ADDRESS: '[email protected]',
    EMAIL_AUTH_USER: '[email protected]',
    EMAIL_AUTH_PASS: '123456',
    EMAIL_HOST: 'smtp.qq.com',
    EMAIL_PORT: 465,
})
customEmail.send('你好', '你好,我很可爱 - 自定义邮件')

// 【推荐】钉钉机器人。官方文档:https://developers.dingtalk.com/document/app/custom-robot-access
const ACCESS_TOKEN = 'xxxxxxxxxxxxxxxxxx'
const SECRET = 'SECxxxxxxxxxxxxxxxx'
const dingtalk = new Dingtalk(ACCESS_TOKEN, SECRET)
dingtalk.send('你好', '你好,我很可爱')

// 企业微信群机器人。官方文档:https://developer.work.weixin.qq.com/document/path/91770
// 企业微信群机器人的使用需要两人以上加入企业,如果个人使用微信推送建议使用 企业微信应用+微信插件 推送。虽然需要配置的内容更多了,但是无需下载企业微信,网页端即可完成操作。
const WX_ROBOT_KEY = 'xxxxxxxxxxxxxxxxxxxxxxx'
const wechatRobot = new WechatRobot(WX_ROBOT_KEY)
wechatRobot.send('你好,我很可爱', 'text')

// 【推荐】企业微信应用推送,官方文档:https://developer.work.weixin.qq.com/document/path/90664
// 微信插件 https://work.weixin.qq.com/wework_admin/frame#profile/wxPlugin
// 参数的介绍请参考:https://developer.work.weixin.qq.com/document/path/90665
// 支持 text 和 markdown 格式,但 markdown 格式仅可在企业微信中查看
const wechatApp = new WechatApp({
    WX_APP_CORPID: 'wwxxxxxxxxxxxxxxxxxxxx',
    WX_APP_AGENTID: 10001, // 请更换为自己的 AGENTID 
    WX_APP_SECRET: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    WX_APP_USERID: '@all',
})
wechatApp.send('你好,我很可爱', 'text')

// pushplus 推送,官方文档:https://www.pushplus.plus/doc/
const PUSH_PLUS_TOKEN = 'xxxxxxxxxxxxxxxxxxxxx'
const pushplus = new PushPlus(PUSH_PLUS_TOKEN)
pushplus.send('你好', '你好,我很可爱')

// iGot 推送,官方文档:https://wahao.github.io/Bark-MP-helper
const I_GOT_KEY = 'xxxxxxxxxx'
const iGot = new IGot(I_GOT_KEY)
iGot.send('你好', '你好,我很可爱', 'https://github.com/CaoMeiYouRen/push-all-in-one')

// Qmsg 酱 推送,官方文档:https://qmsg.zendee.cn
const QMSG_KEY = 'xxxxxxxxxxxx'
const qmsg = new Qmsg(QMSG_KEY)
qmsg.send('你好,我很可爱 - Qmsg', '12345,12346', 'send') // msg:要推送的消息内容;qq:指定要接收消息的QQ号或者QQ群,多个以英文逗号分割,例如:12345,12346


// 息知 推送,官方文档:https://xz.qqoq.net/#/index
const XI_ZHI_KEY = 'xxxxxxxxxxxxx'
const xiZhi = new XiZhi(XI_ZHI_KEY)
xiZhi.send('你好', '你好,我很可爱 - XiZhi')

// 【推荐】PushDeer 推送,官方文档:https://github.com/easychen/pushdeer
const PUSH_DEER_PUSH_KEY = 'xxxxxxxxxx'
const pushDeer = new PushDeer(PUSH_DEER_PUSH_KEY)
pushDeer.send('你好', '你好,我很可爱 - PushDeer', 'markdown')

// 【推荐】Discord Webhook 推送,官方文档:https://support.discord.com/hc/zh-tw/articles/228383668-%E4%BD%BF%E7%94%A8%E7%B6%B2%E7%B5%A1%E9%89%A4%E6%89%8B-Webhooks-
const DISCORD_WEBHOOK = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxx'
const DISCORD_USERNAME = 'My Bot'
const discord = new Discord(DISCORD_WEBHOOK, DISCORD_USERNAME)
// Discord 也支持以下方式添加代理地址
// discord.proxyUrl = 'http://127.0.0.1:8101'
discord.send('你好,我很可爱 - Discord')

// 【推荐】Telegram Bot 推送。官方文档:https://core.telegram.org/bots/api#making-requests
const telegram = new Telegram({
    TELEGRAM_BOT_TOKEN: '111111:xxxxxxxxxxxxxx',
    TELEGRAM_CHAT_ID: 100000,
})
// Telegram 也支持以下方式添加代理地址
// telegram.proxyUrl = 'http://127.0.0.1:8101'
telegram.send('你好,我很可爱 - Telegram')

// OneBot 推送。官方文档:https://github.com/botuniverse/onebot-11
// 本项目实现的版本为 OneBot 11
// 在 mirai 环境下实现的插件版本可参考:https://github.com/yyuueexxiinngg/onebot-kotlin
const oneBot = new OneBot('http://127.0.0.1:5700', 'xxxxxxxxxxx')
oneBot.send('你好,我很可爱 - OneBot 11', 'private', 10001)

更多例子请参考 examples

代理支持

| 环境变量 | 作用 | 例子 | | ----------- | ------------------------------------------ | ---------------------- | | NO_PROXY | 设置是否禁用代理 | true | | HTTP_PROXY | 设置 http/https 代理 | http://127.0.0.1:8101 | | HTTPS_PROXY | 设置 http/https 代理 | http://127.0.0.1:8101 | | SOCKS_PROXY | 通过 socks/socks5 协议设置 http/https 代理 | socks://127.0.0.1:8100 |

本项目通过环境变量来支持请求代理

// 在 nodejs 项目中可通过直接设置环境变量来设置代理
process.env.HTTP_PROXY = 'http://127.0.0.1:8101' // 当请求是 http/https 的时候走 HTTP_PROXY
process.env.HTTPS_PROXY = 'http://127.0.0.1:8101' // 当请求是 http/https 的时候走 HTTPS_PROXY,HTTPS_PROXY 优先
process.env.SOCKS_PROXY = 'socks://127.0.0.1:8100' // 当 HTTP_PROXY 设置时走 SOCKS_PROXY
// process.env.NO_PROXY = true // 设置 NO_PROXY 可禁用代理

在命令行中可手动设置环境变量

set HTTP_PROXY='http://127.0.0.1:8101' # Windows
export HTTP_PROXY='http://127.0.0.1:8101' # Linux
cross-env HTTP_PROXY='http://127.0.0.1:8101' # 通过 cross-env 这个包来跨平台

🛠️ 开发

本项目采用 TypeScript 开发,使用 rollup 打包,可以完美实现类型提示和摇树优化,对于未使用到的模块,会在编译阶段去除。

npm run dev

🐛 debug

本项目使用 debug 这个包来 debug ,如果要开启调试则设置环境变量为 DEBUG=push:* 即可,例如

cross-env DEBUG=push:* NODE_ENV=development ts-node-dev test/index.test.ts # 因为一些原因该文件未上传,可自行编写测试用例

🔧 编译

npm run build

🔍 Lint

npm run lint

💾 Commit

npm run commit

👤 作者

CaoMeiYouRen

🤝 贡献

欢迎 贡献、提问或提出新功能!如有问题请查看 issues page. 贡献或提出新功能可以查看contributing guide.

💰 支持

如果觉得这个项目有用的话请给一颗⭐️,非常感谢

🌟 Star History

Star History Chart

📝 License

Copyright © 2022 CaoMeiYouRen. This project is MIT licensed.


This README was generated with ❤️ by cmyr-template-cli