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

weixiao.js

v2.2.2

Published

腾讯微校应用开放平台 API

Readme

weixiao.js - 腾讯微校应用开放平台 API

腾讯微校应用开发文档:http://open.weixiao.qq.com/app/index.html#/api?content=beforeStart&_k=d8q1ae

安装

yarn add weixiao.js

npm install weixiao.js -S

使用

服务器端使用

const Weixiao = require('weixiao.js');

const wx = new Weixiao({
  key: 'your key',
  secret: 'your secret',
  token: 'your token' // 仅 "消息回复类" 应用需要 token
});

(async () => {

  // 获取公众号信息
  // 返回结果格式如:{ name: '人民日报', ..., qrcode: '公众号二维码URL' }
  const mediaInfo = await wx.getMediaInfo('media id');

  // 获取公众号设置的应用关键词
  // 返回结果格式格式如:[ '关键词1', '关键词2', ... ]
  const mediaKeywords = await wx.getMediaKeywords('media id');

  // 签名验证
  // 该方法会根据传入的参数自动进行微校开放平台签名验证或微信公众平台签名验证
  // 返回结果格式格式如:true
  const checkSignResult = wx.checkSign('待验证的参数对象');

  // 时间戳验证
  // 该方法会检查当前时间戳与传入参数中的 timestamp 字段是否在一个合理的范围,以防止重放攻击
  // 返回结果格式格式如:true
  const checkIntervalResult = Weixiao.checkInterval(
    '待验证的参数对象', // 若参数对象不含 timestamp 字段,将直接返回 false
    60 // 允许的最大时间差,单位:秒
  );

})();

浏览器端使用

你需自行引入 Promise Polyfill(推荐:taylorhakes/promise-polyfill)。

import Weixiao from 'weixiao.js';

const wx = new Weixiao({
  key: 'your key',
  secret: 'your secret'
});

// 获取公众号信息
wx.getMediaInfo('media id')
  .then(info => console.log(info))
  .catch(err => console.log(err));