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

@theforce/core

v2.0.0

Published

Core library for TheForce hand tracking

Readme

@theforce/core

The core hand tracking library for TheForce, built on MediaPipe. This package provides the fundamental hand tracking capabilities and can be used independently or as a dependency for framework-specific integrations.

Installation

npm install @theforce/core
# or
yarn add @theforce/core

Quick Start

import { HandTracker } from "@theforce/core";

// Initialize the hand tracker with optional configuration
const tracker = new HandTracker({
  hoverDelay: 2000, // Time in milliseconds to hover before triggering a click (default: 2000ms)
  sensitivityX: 1.5, // Multiplier for horizontal cursor movement sensitivity (default: 1)
  sensitivityY: 1.5, // Multiplier for vertical cursor movement sensitivity (default: 1)
  cursorImageUrl:
    "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTcgMkwxNyAxMkw3IDIyVjJaIiBmaWxsPSIjNGNhZjUwIi8+Cjwvc3ZnPgo=", // Optional: URL for a custom cursor image
  debug: true, // Set to true to display the camera feed in the bottom right corner for debugging
});

// Initialize the tracker (creates the virtual cursor element and sets up camera)
await tracker.initialize();

// Start tracking hands
await tracker.start();

// Listen for hand tracking results (e.g., hand landmarks)
tracker.onResults((results) => {
  const { multiHandLandmarks, multiHandedness } = results;
  // Process hand landmarks, e.g., to draw on a canvas or control UI
  if (multiHandLandmarks && multiHandLandmarks.length > 0) {
    console.log("Detected hands:", multiHandLandmarks);
  }
});

// To stop tracking
// await tracker.stop();

Configuration Options

The HandTracker constructor accepts an optional configuration object with the following properties:

| Option | Type | Default | Description | | --------------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | hoverDelay | number | 2000 | Time in milliseconds to hover before triggering a click. | | sensitivityX | number | 1 | Multiplier for horizontal cursor movement sensitivity. Higher values make the cursor move faster horizontally. | | sensitivityY | number | 1 | Multiplier for vertical cursor movement sensitivity. Higher values make the cursor move faster vertically. | | cursorImageUrl | string | - | Optional URL for a custom image to be used as the virtual cursor. If not provided, a default red circle is used. | | cursorLandmarkIndex | number | 9 | The index of the landmark to use for cursor positioning (e.g., 0 for wrist, 8 for index finger tip, 9 for middle finger base). Defaults to 9 (middle finger base) for a more central hand tracking experience. | | debug | boolean | false | If true, the camera feed will be displayed in the bottom right corner for debugging purposes. |

CSS Classes

The library adds the following CSS classes to elements that you can style:

  • .force-hoverable: Applied to elements with data-hoverable="true" attribute, indicating they can be interacted with.
  • .force-hover: Applied to a force-hoverable element when the virtual cursor is hovering over it.
  • .force-loading: Applied to the virtual cursor element when a hover action is in progress (e.g., waiting for hoverDelay to trigger a click). This class can be used to style the loading animation.

Browser Support

This library relies on MediaPipe and WebRTC, requiring modern browser support:

  • Chrome 88+
  • Firefox 85+
  • Safari 14+
  • Edge 88+