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 🙏

© 2024 – Pkg Stats / Ryan Hefner

interaction-recorder

v0.0.6

Published

record user interactions in the browser

Downloads

4

Readme

event-recorder

recorder ui events and emit them in a smart way -# interaction recorder

This is a project aiming for recording user's interaction to a reproducible data.

how to use

npm install interaction-recorder
import { InteractionRecorder } from 'interaction-recorder';

const interactionRecorder = new InteractionRecorder(window, {
  onEmit: (step) => {
    console.log(step);
  },
});

interactionRecorder.start();
// do some interaction to website and see what will be logged to console

project structure

It contains three core component:

1.observer

observer is for collecting event triggered by user's interaction.

built-in recorder has an observer that observe:

  • mouse interaction
  • keyboard interaction
  • text input interaction
  • scroll interaction

2.matcher

An interaction of user may trigger multiple events, matcher is for composing those event into an interaction event.

built-in recorder has a matcher called PatterMatcher, match the pattern of event group and compose it to a single interaction event.

It has three period to process a single event from observer:

  • actionBeforeCollectStep:
    check if new event will cause the previous event group to be emitted;
    or the event should be ignored in this period;
    or the event should not be processed anymore.
  • actionWhileCollectStep:
    check if the event need to be collected;
    or the event should be ignored in this period;
    or the event should not be processed anymore.
  • actionAfterCollectStep:
    check if the event group need to be emitted after collect event;
    or the event should be ignored in this period;
    or the event should not be processed anymore.

and a group of pattern to match to event group:

  • CLICK
  • DRAG
  • SCROLL
  • TEXTING
  • UNKNOWN

3.recorder

recorder is the bridge between observer and matcher, it will collect event from observer and send it to matcher. And will get interaction composed by matcher. Also, it handle the communication to outside.
A recorder could have multiple observer at the same time, but only one matcher.

extension

observer and matcher can be extended to handle more event. use recorder.extendAction to add extra observer and extend matcher.

detail to see link