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

mpbehavior

v0.0.16

Published

数据采集

Readme

小程序反作弊npm包使用指南

一、先决条件

node v8.11.3+ npm v5+ 小程序基础库版本 2.2.1+ 开发者工具 1.02.1808300+

二、安装与运行

  1. 在小程序项目中是否有package.json,如果没有请先运行
npm init
  1. 安装小程序反作弊npm包
npm i mpbehavior@latest --save
  1. 点击开发者工具中的菜单栏:工具 --> 构建 npm

  2. 勾选“使用 npm 模块”选项:详情 --> 本地设置 --> 使用npm模板

  3. 构建完成后即可使用小程序反作弊npm包

    使用npm包中的behavior.js

    import behavior from 'mpbehavior/behavior'

    使用npm包中的反作弊组件

    "usingComponents": {
        "weixinBehavior": "mpbehavior"
    }

三、项目中使用

  1. 在反作弊页面,json文件引入该组件
"usingComponents": {
    "weixinBehavior": "mpbehavior"
}

wxml文件最外层引用:函数名必须是getHehavior

<weixinBehavior bind:getHehavior='getHehavior'></weixinBehavior>

js文件获取数据

getHehavior(event) {
    this.setData({
        behavior: event.detail.behavior
    })
}
  1. 在点击上报页面,引入behavior.js文件
import behavior from 'mpbehavior/behavior'

在点击事件上应用

detailUrl = behavior.getBehavior(clickUrl, data, true)

其中:

@param {[String]} clickUrl [需要追加ac字段的链接]
@param {[String]} data [收集到的数据]
@param {[Bolean]} isMiddlePage  [是否是中间页]