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

ux-ai

v1.0.1

Published

Enabling websites to evaluate and enhance user experience with Artificial Intelligence

Readme

Table of Contents

Introduction

UX-AI provides the ability to strengthen user experience by intelligently inferring user behavior status given demonstrated page interactions. In realtime, the AI agent periodically classifies such behavior statuses as either distracted, engaged, idle, or rushed.

Our goal is for sites to leverage this valuable information to improve user experience during the browsing session.

For instance, once detecting that a user is rushed, a component containing contact information can be discretely presented before the user navigates away. See more use cases and examples here.

Most of the time, user behavior is classified as engaged, suggesting that the user is following along with the page as intended.

Don't worry, UX-AI does not save any observations of user behavior. No user-related data collected by UX-AI ever leaves the browser. Upon refresh or page close, all respective data UX-AI disappears.

Demo

View a live demo here.

Installation

First, make sure to link TensorFlow.js, the ML framework on top of which UX-AI's models are built.

<head>
    ...
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js"></script>
</head>

Download UX-AI with npm

npm install ux-ai

or link the package with a <script> tag

<head>
    ...
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/ux-ai@latest/UXAI.js"></script>
</head>

Getting Started

If using a UI framework with Node.js, don't forget to import the package. This is not necessary if the package is imported via <script> tag.

// top of file
import UXAI from "ux-ai"

Instantiate a UXAI object, passing in an object of options.

const uxai = new UXAI({
    inferenceInterval: 10000, // ms between predictions, must be between 3000 and 10000.
    inferenceCallback: history => {}, // history is array of behavior status Strings
})

Note that behavior status classifications are more stable with a greater inferenceInterval.

Examples and Applications

Sign Out the user when idle for 5 inference cycles:

if (history.slice(history.length - 5).every((status) => status === "idle")) {
    signOutCurrentUser();
}

Trigger an auto-save before the distracted user forgets:

if (history[history.length - 1] === "distracted") {
    saveDocument();
}

Gauge session page interest after 10 inference cycles have passed:

if (history.length >= 10) {
    const interest = history.filter(status => status === "engaged").length / history.length;
    console.log(`Interested ${Math.round(interest * 100)}% of the time`);
}

Of course, these are just a few simple examples. Feel free to take UX-AI in whatever direction you choose, staying well within ethical boundaries.

Future Improvements

Observation and intelligent prediction/classification methods are always under further development, though often occurring outside this repository. UX-AI will automatically use the most recently published ML model, as it is loaded over the cloud.

License and Attribution

This project is released under the Apache 2.0 License. In your own derivations, significant changes should be stated and attributions should be maintained in the NOTICE file.