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

wechat_interaction_jsapi

v1.0.7

Published

[![npm version](https://badge.fury.io/js/wechat_interaction_jsapi.svg)](http://badge.fury.io/js/wechat_interaction_jsapi)

Readme

Wechat JS-API接口

npm version

功能:

用于管理和获取微信 JSSDK 生产的access_tokenjsapi_ticket和签名(signature

Installation

npm i wechat_interaction_jsapi

Init

let Jsapi = require("wechat_interaction_jsapi"); 

Usage

WECHAT_APPID, WECHAT_APPSECRET 分别为开发者 id 和密码,在微信公众平台->开发->基本配置里可找到

const jssdk = new Jsapi(WECHAT_APPID, WECHAT_APPSECRET);

1、获取 access_token, 返回promise对象,resolve回调返回string

jssdk.getAccessToken().then(
    re => console.log(re)
).catch(err => console.error(err));

2、获取 jsapi_ticket, 返回promise对象,resolve回调返回string

jssdk.getJsApiTicket().then(
    re => console.log(re)
).catch(err => console.error(err));

3、获取 JS-SDK 权限验证的签名, 返回promise对象,resolve回调返回json

jssdk.getSignPackage(url).then(
    re => console.log(JSON.stringify(re))
).catch(err => console.error(err));

流程图

1、第一种方式(参数重复出现,条理清楚)

2、第二种方式(参数不重复出现,条理不清楚)

前端调用方法

1、参考官方文档

https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115

2、注意事项:

(1)确认白名单已配置:微信公众平台->开发->基本配置->ip白名单

(2)确认JS接口安全域名已配置:微信公众平台->设置->公众号配置->JS接口安全域名