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

user-behavior-analysis

v2.0.2

Published

一个用于追踪和记录用户在网页上各种交互行为的 TypeScript 库

Downloads

19

Readme

User Behavior Analysis - TypeScript 版本

一个用于追踪和记录用户在网页上各种交互行为的 TypeScript 库。

🚀 快速开始

安装

npm install user-behavior-analysis

基础使用

import userBehaviour from 'user-behavior-analysis';

// 配置并开始追踪
userBehaviour.config({
    clicks: true,
    mouseMovement: true,
    keyboardActivity: true,
    processData: (results) => {
        console.log('用户行为数据:', results);
    }
});

userBehaviour.start();

✨ 功能特性

  • 🖱️ 鼠标行为追踪 - 移动轨迹、点击位置、滚动行为
  • ⌨️ 键盘活动监控 - 按键记录、输入行为分析
  • 📱 触摸事件支持 - 移动设备触摸交互
  • 📝 表单交互追踪 - 表单提交、输入行为
  • 🎵 媒体交互监控 - 音视频播放行为
  • 🔄 页面状态监控 - 窗口大小、页面可见性、导航历史
  • 实时数据处理 - 可配置的数据处理间隔
  • 🌐 自动数据发送 - 支持后台服务器数据推送
  • 🛡️ 隐私保护 - 可配置的数据收集范围
  • 📊 类型安全 - 完整的 TypeScript 类型定义

📚 API 参考

核心方法

// 配置选项
userBehaviour.config(options);

// 开始/停止追踪
userBehaviour.start();
userBehaviour.stop();

// 获取结果
const results = userBehaviour.showResult();

// 注册自定义事件
userBehaviour.registerCustomEvent('eventName', callback);

🌐 浏览器支持

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+
  • 移动端浏览器

📄 许可证

MIT License - 查看 LICENSE 文件了解详情。

📖 详细文档

查看 DOCUMENTATION.md 获取完整的使用指南、配置选项、API参考和示例代码。

开始使用 User Behavior Analysis 库,深入了解您的用户行为! 🚀