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

@smartupcorp/qdollar-super-quick-recognizer

v1.0.1

Published

A modern, strongly-typed TypeScript implementation of the $Q Super-Quick Recognizer.

Downloads

322

Readme

$Q Super-Quick Recognizer

npm version License

A modern, strongly-typed, and modular TypeScript implementation of the $Q Super-Quick Recognizer.

This library is a high-performance, multi-stroke gesture recognizer. Unlike the original $1 recognizer, $Q supports gestures made of multiple lines (like "X", "T", or Kanji) and uses a Lookup Table (LUT) for ultra-fast recognition.

Installation

Install the package using your preferred package manager:

# npm
npm install @smartupcorp/qdollar-super-quick-recognizer

# yarn
yarn add @smartupcorp/qdollar-super-quick-recognizer

# pnpm
pnpm add @smartupcorp/qdollar-super-quick-recognizer

Quick Start

1. Recognizing Default Gestures

The recognizer comes with 16 standard multi-stroke gestures (T, N, D, P, X, H, I, exclamation, star, etc.).

import {
  Point,
  QDollarRecognizer,
  DEFAULT_GESTURES,
} from "@smartupcorp/qdollar-super-quick-recognizer";

// Initialize with default multi-stroke gestures
const recognizer = new QDollarRecognizer(DEFAULT_GESTURES);

// Points include an ID to identify which stroke they belong to
const userPoints = [
  new Point(30, 146, 1), new Point(106, 222, 1), // Stroke 1
  new Point(30, 225, 2), new Point(106, 146, 2)  // Stroke 2
];

// Returns a sorted array of Result objects (highest score first)
const results = recognizer.recognize(userPoints);

if (results.length > 0) {
  const bestMatch = results[0];
  console.log(
    `Recognized as: ${bestMatch.name} (Score: ${Math.round(bestMatch.score * 100)}%)`,
  );
}

2. Adding Custom Multi-stroke Gestures

const recognizer = new QDollarRecognizer([]);

// Define a custom 2-stroke gesture
const myShape = [
  new Point(10, 10, 1), new Point(100, 10, 1), // Line 1
  new Point(50, 10, 2), new Point(50, 100, 2)  // Line 2
];

recognizer.addGesture("my-custom-shape", myShape);

API Reference

QDollarRecognizer

recognize(points: Point[]): Result[]

Calculates the similarity between the input points and loaded templates. Returns a list of results sorted by score (descending).

addGesture(name: string, points: Point[]): number

Adds a new template to the recognizer.

deleteUserGestures(): number

Resets the templates to the initial set passed during construction.

License

This project is licensed under the New BSD License - see the LICENSE file for details.

Acknowledgements

The core algorithm is a TypeScript port of the $Q Super-Quick Recognizer originally developed by:

  • Radu-Daniel Vatavu, Ph.D. (University Stefan cel Mare of Suceava)
  • Lisa Anthony, Ph.D. (University of Florida)
  • Jacob O. Wobbrock, Ph.D. (University of Washington)

Vatavu, R.-D., Anthony, L. and Wobbrock, J.O. (2018). $Q: A Super-Quick, Articulation-Invariant $1-Family Recognizer. Proceedings of the ACM Conference on Human Factors in Computing Systems (CHI '18). Montreal, Quebec (April 21-26, 2018). New York: ACM Press, paper no. 531.

Original JavaScript code is distributed under the New BSD License.