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

@tencent-wetest/wesight-sdk

v2.1.3

Published

wesight 是WeTest提供的小程序异常监控SDK和安全网关SDK,只需引入 SDK 即可自动完成所有监控上报和网关配置请求的发送。

Readme

wesight-sdk

wesight 是WeTest提供的小程序异常监控 SDK,只需引入 SDK 即可自动完成所有监控上报。

安装

NPM

在项目支持 NPM 时推荐使用 NPM 安装 wesight SDK。

$ npm install @tencent-wetest/wesight-sdk

使用

初始化

import wesight from '@tencent-wetest/wesight-sdk';

wesight.init({
    url: 'https://[domain]/miniapp/cgi',
    secret_id: '154a6107154a431xxxxxxx', // 密钥ID
    secret_key: 'd6d24d1b160946xxxxxxx', // 密钥KEY
})

设置自定义异常上报规则(全局)

// 业务定制版(灵活性高),根据业务中http请求的req和res参数,自定义拦截器函数设置异常上报规则,返回一个布尔值 - true:上报;false:不上报
wesight.setFailedRequestRules((req, res) => { // 响应体中的code码等于101的情况下,即触发上报
  if (res.data.code === 101) {
    return true;
  }
})

// 简单通用版,设置一个通用的http请求响应体中响应码的键和值,来表示正确的返回值,响应体中不存在设置的键值对的话,即上报
wesight.setFailedRequestRules({ // 响应体中的code码等于200的情况下,即表示正常返回,否则触发上报
  codeKey: 'code',
  codeValue: 200
})

自定义上报

wesight.customReport({
    desc: '上报描述', // string 类型
    content: '上报内容' // 任意类型
})

发送加密请求

目前只支持GET和POST,请求参数通wx.request

    wesight.encry.request({
      url: "配置地址",
      method: "POST",
      data: {
        a: 1,
        b: 2,
      },
      success(res) {
        console.log(res);
      },
      fail({errMsg, errno}) {
        console.log(errMsg, errno);
      }
    });