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

wecom

v0.8.3

Published

**目前只封装了基本的模块 有兴趣的同学可以一起加入并丰富其 API**

Downloads

50

Readme

企业微信 Node API

目前只封装了基本的模块 有兴趣的同学可以一起加入并丰富其 API

各个子模块相关文档 请前往 github 各个项目中查看

目前已完成模块

应用管理模块

通讯录管理模块

素材管理模块

消息推送模块

oa 管理模块

企业微信文档地址 点击前往

安装模块

import { Wecom } from "wecom";

快速开始

// 初始化企业微信对象
const wecom = new Wecom({
  corpId: process.env.CORPID,
  corpSecret: process.env.CORP_SECRET,
});
// 发送消息
wecom.request({
  url: "/message/send",
  method: "POST",
  // 发送消息的参数参照 [(官方文档)](https://work.weixin.qq.com/api/doc/90000/90135/90236) [(API 文档)]()
  data: {
    touser: "username",
    msgtype: "text",
    agentid: Number(process.env.TEST_AGENT_ID),
    text: {
      content: "test",
    },
  },
});

参数说明

下面的必要参数都是申请企业微信应用时分配给到的,需要和相关负责人说明需要

| 参数名 | 参数类型 | 必填 | 参数描述 | | :--------- | :------: | :--: | :------------------------------------------------------------- | | corpId | string | 是 | 企业微信 corpid | | corpSecret | string | 是 | 企业微信 corpsecret | | baseURL | string | 否 | 企业微信服务器地址 (默认:https://qyapi.weixin.qq.com/cgi-bin/) | | retryTimes | number | 否 | 认证失败的错误重试次数 其他错误信息不进行重试(默认:3) |

静态方法

方法名setGlobal 说明:添加全局配置信息

Wecom.setGlobal((config: Partial<WecomConfig>));

实例方法

方法名getToken 说明: 获取发送需要用到的 token 信息

wecom.getToken();

方法名request 说明:向企业微信发送相关的请求

wecom.request((config: AxiosRequestConfig));

方法名:createApi 说明:创建新的调用 api

wecom.createApi((path: string), fn);

项目构建

yarn run build

单元测试

请先创建.env文件,并将.env.example中的内容复制过去

相关的配置信息为作者创建的测试企业。如果有其他的需求,请通过issue提出

yarn run test

目录: