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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rrweb-modual

v1.0.3

Published

rrweb 模块集合 - 包含 rrweb 相关的所有核心模块

Readme

rrweb-modual

rrweb 模块集合 - 包含 rrweb 相关的所有核心模块的统一 node 库。

功能特性

  • 🎯 统一入口: 提供所有 rrweb 相关模块的统一访问入口
  • 📦 模块化设计: 包含 rrdom、rrweb、rrweb-player 等核心模块
  • 🔧 TypeScript 支持: 完整的 TypeScript 类型定义
  • 🚀 高性能: 基于原生 rrweb 核心,性能优异
  • 📱 多平台支持: 支持浏览器和 Node.js 环境

安装

npm install rrweb-modual
# 或
yarn add rrweb-modual
# 或
pnpm add rrweb-modual

快速开始

基本使用

import { record, Replayer } from 'rrweb-modual';

// 开始录制
const stopRecording = record({
  emit(event) {
    console.log('录制事件:', event);
  },
  recordCanvas: true,
  recordCrossOriginIframes: true,
});

// 停止录制
// stopRecording();

// 创建回放器
const replayer = new Replayer(events, {
  root: document.getElementById('replayer'),
  speed: 1,
  skipInactive: true,
});

// 开始回放
replayer.play();

完整示例

查看 使用示例 目录,包含:

运行示例:

cd example
npm install
npm run serve  # 启动浏览器示例
npm run example:node  # 运行 Node.js 示例
npm run example:ts    # 运行 TypeScript 示例

详细使用方法

基础使用

import { record, replay, Replayer } from 'rrweb-modual';

// 开始录制
const stopRecord = record({
  emit(event) {
    console.log('录制事件:', event);
  }
});

// 停止录制
stopRecord();

// 回放录制
const replayer = new Replayer(events);
replayer.play();

高级功能

import { 
  record, 
  replay, 
  Replayer, 
  Player,
  snapshot,
  addCustomEvent 
} from 'rrweb-modual';

// 添加自定义事件
addCustomEvent('custom-event', {
  data: { custom: 'data' }
});

// 创建快照
const snapshotData = snapshot(document);

// 使用播放器组件
const player = new Player({
  target: document.body,
  props: {
    events: recordedEvents
  }
});

包含的模块

  • rrdom: DOM 操作和虚拟 DOM 实现
  • rrdom-nodejs: Node.js 环境的 DOM 实现
  • rrweb: 核心录制和回放功能
  • rrweb-player: 视频播放器组件
  • rrweb-snapshot: 快照功能
  • rrvideo: 视频相关功能
  • types: TypeScript 类型定义
  • web-extension: 浏览器扩展支持

API 文档

详细的 API 文档请参考各个子模块的文档:

开发

# 安装依赖
npm install

# 构建
npm run build

# 开发模式
npm run dev

# 测试
npm test

许可证

MIT License

作者

yxye [email protected]