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

nui-commander

v1.0.2

Published

Give command with hands low cpu usage based on block detect webcam samples. Top performance js code.

Readme

nui-commander

Control your UI with nothing but your hands in the air.

Version 1.0.0

nui-commander is a browser-based motion detection framework that turns a webcam feed into a gesture-driven UI system. It detects movement in a live video stream and maps it to an 8×8 grid of interaction zones — each zone can trigger actions, animate canvas elements, or drive any custom logic you wire up.

The interface renders directly on top of the video in an augmented reality style — no mouse, no touch, no keyboard required.

screenshot


How it works

The canvas engine continuously diffs successive webcam frames. When movement is detected in a grid zone, that zone's opacity accumulates and its action fires. When the zone goes idle, opacity fades back to zero. Everything runs on the main thread at low CPU cost — no WASM, no heavy ML models required.


Quick Start

index.html

<html>
<head>
  <link rel="stylesheet" href="css/style.css">
  <script type="module" src="myNuiApp.js"></script>
</head>
<body>
  <div id="container">
    <div id="nui-commander-container">
      <video id="webcam" autoplay width="640" height="480"></video>
      <canvas id="canvas-source" width="640" height="480"></canvas>
      <canvas id="canvas-blended" width="640" height="480" style="display:none;"></canvas>
      <div id="xylo"></div>
    </div>
  </div>
</body>
</html>

myNuiApp.js

import {
  indicatorsBlocks,
  CanvasEngine,
  interActionController,
  NuiMsgBox
} from "nui-commander";

const nuiCommander = {};
nuiCommander.drawer = new CanvasEngine(interActionController);
nuiCommander.drawer.draw();

// Add the default 8×8 grid overlay
nuiCommander.indicatorsBlocks = indicatorsBlocks;
nuiCommander.drawer.elements.push(nuiCommander.indicatorsBlocks);

// Push a gesture-driven message box
nuiCommander.drawer.elements.push(
  new NuiMsgBox("Do you love this project?", function(answer) {
    nuiCommander.drawer.removeElementByName("NuiMsgBox");

    if (answer === "yes") {
      setTimeout(() => {
        nuiCommander.drawer.elements.push(
          new NuiMsgBox("Activate commander options?", function(answer) {
            nuiCommander.drawer.removeElementByName("NuiMsgBox");
            if (answer === "yes") alert("Great, let's go!");
          })
        );
      }, 100);
    } else {
      window.location.href = "https://google.com";
    }
  })
);

console.info("nui-commander controls attached.");

Built-in Controls

All controls share the same interface — push them into engine.elements and they handle their own drawing and update loop.

| Control | Description | |---|---| | NuiMsgBox | Yes / No confirmation dialog | | NuiMenu | Vertical list with dwell selection | | NuiRadialMenu | Circular sector menu, columns mapped to sectors | | NuiSlider | Horizontal value control via left / right zones | | NuiToggle | Single zone on/off flip with animated pill | | NuiToast | Timed notification, fades in and out automatically | | NuiCursor | Tracks center of mass of active zones as a smooth cursor | | NuiFaceDetect | HUD overlay using native browser FaceDetector API (Must be activated from chrome://flags)| | indicatorsBlocks | Default 8×8 grid overlay with opacity, text, and icon support |


Tile / Mask visual area

You can replace the default grid highlight with custom tile images to create a textured background mask:

nuiCommander.indicatorsBlocks.icons = [];

for (let x = 0; x < 64; x++) {
  const tile = new Image();
  tile.src = "images/tile.png";
  tile.onload = function() {
    nuiCommander.indicatorsBlocks.icons.push(this);
  };
}

Objectives

  • Works in Chrome, Opera, Safari, Firefox and all mobile browsers
  • Webcam motion detection with no server-side processing
  • Low CPU footprint — pure canvas diffing, no heavy dependencies
  • Composable element system — push any control into the engine and it just works
  • Clean input/output event model — easy to integrate into any existing app

Used In

vuletube

vuletube screenshot

vue-typescript-starter

nui-commander is used as a git submodule in this Vue + TypeScript boilerplate project.


Licence & Credits

MIT Nikola Lukic [email protected] MIT — based on magic-xylophone by soundstep.