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

@mikael_tenshio/adaptive-ux

v1.0.1

Published

A 'Lite Mode' Manager for web apps.

Readme

adaptive-ux

npm version Node.js CI

A "Lite Mode" Manager for modern web apps.

adaptive-ux intelligently monitors the user's device capabilities (CPU, Network, and Battery) to determine the optimal user experience "Vibe". This allows you to gracefully degrade resource-intensive features (like heavy animations or high-resolution media) for users on slower networks or low-end devices.

Installation

npm install adaptive-ux

Core Concepts

The library calculates a Vibe based on the health of the user's device:

  • PREMIUM: Excellent connection, high battery, and fast CPU.
  • MEDIUM: Average device capabilities. Some light throttling recommended.
  • LITE: Slow network, low battery, or struggling CPU. You should turn off heavy animations and defer non-critical scripts.

Usage

Initialize the manager and listen for the vibechange event to adjust your application's UI.

import { AdaptiveUXManager } from "adaptive-ux";

// 1. Initialize the manager with optional configuration
const uxManager = new AdaptiveUXManager({
  initialVibe: "PREMIUM",
  checkInterval: 5000, // Evaluate health every 5 seconds
  persistence: {
    enabled: true, // Save user preferences to localStorage
    key: "my-app-vibe",
  },
  network: {
    // Optional: Configure an active ping test for accurate network throughput
    ping: {
      url: "https://your-domain.com/small-ping-file.bin",
      sizeInBytes: 50000,
    },
  },
});

// 2. Listen for capability changes
uxManager.addEventListener("vibechange", (event: any) => {
  const { vibe, health } = event.detail;

  console.log(`Current Vibe is: ${vibe}`);
  console.log("Device Health Scores (0 to 1):", health);

  if (vibe === "LITE") {
    document.body.classList.add("lite-mode");
    // Disable animations, load lower-res images, pause background videos, etc.
  } else {
    document.body.classList.remove("lite-mode");
    // Enable premium features
  }
});

Manual Overrides

Sometimes users want to explicitly force "Lite Mode" or "Premium Mode" regardless of what their device capabilities are. You can manually set the vibe, which stops the automatic background checks.

// Force Lite Mode (saves to localStorage if persistence is enabled)
uxManager.setManualVibe("LITE");

// Re-enable automatic device capability monitoring
uxManager.setManualVibe(null);

API

AdaptiveUXManager(config?: AdaptiveUXConfig)

Creates a new instance and automatically starts health polling.

  • getCurrentState(): Synchronously returns the current { vibe, health } state.
  • setManualVibe(vibe: Vibe | null): Forces a specific vibe or restores auto-detection.
  • stop(): Clears the interval preventing further background checks.
  • start(): Resumes background health polling.