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

hand-tracker-interaction

v0.1.0

Published

Plug-and-play hand-gesture interaction library for the web — pinch click, drag, two-hand zoom/rotate, two-finger scroll, swipe back/forward. Powered by MediaPipe.

Readme

hand-tracker-interaction

Plug-and-play hand-gesture interaction for the web. Uses MediaPipe to detect both hands in the user's webcam and turns common gestures into native DOM events you already handle (click, contextmenu, scroll, history navigation, two-hand zoom/rotate, drag & drop). Most apps need a single line of JS plus a couple of data-hand-* attributes on existing markup.

Install

npm install hand-tracker-interaction

The library expects a MediaPipe hand model file at /hand_landmarker.task on your site root. Download it once into your public/ folder:

curl -fsSL -o public/hand_landmarker.task \
  https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task

If you serve it from a different path, pass it as an option:

await startHandInteraction({ modelAssetPath: '/assets/hand_landmarker.task' });

Quick start (vanilla)

<script type="module">
  import { startHandInteraction } from 'hand-tracker-interaction';
  await startHandInteraction();
</script>

<button onclick="alert('hi')">Click me</button>
<div data-hand-draggable>Drag me</div>
<div data-hand-zoomable data-hand-rotatable>Pinch with two hands</div>

Quick start (React)

import { HandInteraction } from 'hand-tracker-interaction/react';

export default function App() {
  return (
    <HandInteraction numHands={2}>
      <button onClick={() => console.log('clicked')}>Click</button>
      <div data-hand-draggable>Drag me</div>
    </HandInteraction>
  );
}

Gestures

| Gesture | What it does | DOM signal | |---|---|---| | Pinch (thumb + index, short) | Click | MouseEvent('click') on element under the pinch | | Pinch + move | Drag & drop | uses [data-hand-draggable] | | Thumb + middle finger | Right click / context menu | MouseEvent('contextmenu') | | Index + middle pegged together + move | Scroll vertical/horizontal | scrollBy on the closest scrollable ancestor | | Open palm + horizontal swipe | Browser back / forward | history.back() / history.forward() | | Two-hand pinch | Zoom + rotate | applies CSS transform to [data-hand-zoomable] / [data-hand-rotatable] |

Hit-test for clicks, drags, and right-click happens along the segment between the involved fingers, not just at the fingertip — anything the glowing line crosses is in scope.

Options

await startHandInteraction({
  numHands: 2,
  modelAssetPath: '/hand_landmarker.task',
  showSkeleton: true,           // debug skeleton overlay
  showCursors: true,
  pinchStartThreshold: 0.25,    // dist(thumb, index) / handSize
  pinchEndThreshold: 0.45,
  scrollSpeed: 2,
  scrollInverted: false,        // true = touchpad style
  historyNavigation: true,      // open-palm swipe = history back/forward
  handMissingGraceMs: 220,      // tolerate brief detection drops mid-drag
});

You can opt out of the default history navigation per gesture by listening to the recognizer events and calling preventDefault:

handle.gesture.addEventListener('swipeleft', (e) => e.preventDefault());

Direct API

If you want full control, the lower-level building blocks are also exported from the package root:

import {
  CameraManager,
  HandTrackerEngine,
  GestureRecognizer,
  CursorLayer,
} from 'hand-tracker-interaction';

See BLUEPRINT.md for the architecture and design notes.

License

MIT