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

@dezchai/cursory

v0.1.1

Published

Bun/TypeScript port of cursory for generating realistic mouse trajectories.

Downloads

192

Readme

cursory

TypeScript port of the original Python project Vinyzu/cursory.

This package generates human-like mouse trajectories by selecting from a dataset of recorded trajectories, morphing them to the requested start and end points, and re-sampling them with timing noise.

Install

npm install @dezchai/cursory
bun add @dezchai/cursory

If you are using this repository directly:

npm install
bun install

Basic Usage

import { generateTrajectory } from "@dezchai/cursory";

const { points, timings } = generateTrajectory([0, 0], [200, 100]);

Example Trajectories

These visuals come from the original project and illustrate the style of generated paths:

| Random Points | Same Points | Points / Velocity | |:--:|:--:|:--:| | | | |

API

generateTrajectory(start, end, options?)

Generates a trajectory between two points.

import { generateTrajectory, type Point, type RandomSource } from "@dezchai/cursory";

const start: Point = [25, 40];
const end: Point = [640, 360];

const result = generateTrajectory(start, end, {
  frequency: 60,
  frequencyRandomizer: 1,
});

console.log(result.points);
console.log(result.timings);

Parameters

  • start: [number, number] - starting point.
  • end: [number, number] - ending point.
  • options.frequency?: number - target sample rate in Hz. Defaults to 60.
  • options.frequencyRandomizer?: number - maximum per-sample timing jitter in milliseconds. Defaults to 1.
  • options.random?: { next(): number } - optional deterministic random source for repeatable outputs.

Returns

  • points: [number, number][] - sampled trajectory points.
  • timings: number[] - timestamps in milliseconds, aligned with points.

getTrajectoryCount()

Returns the number of bundled source trajectories in the dataset.

Deterministic Usage

You can pass a custom random source if you want reproducible output for tests or debugging.

import { generateTrajectory, type RandomSource } from "@dezchai/cursory";

class SeededRandom implements RandomSource {
  private state: number;

  constructor(seed: number) {
    this.state = seed >>> 0;
  }

  next(): number {
    this.state = (1664525 * this.state + 1013904223) >>> 0;
    return this.state / 0x100000000;
  }
}

const result = generateTrajectory([0, 0], [300, 180], {
  random: new SeededRandom(12345),
});

Compatibility

This package is built for modern ESM runtimes and can be installed with either npm or Bun.

  • Package managers: npm, Bun
  • Runtimes: Node.js, Bun
  • Module format: ESM
  • Published entrypoint: dist/index.js

Copyright and License

This project is licensed under GPL-3.0-or-later.

The bundled trajectory dataset and original methodology come from Vinyzu/cursory and remain subject to the same license terms.

Commercial usage is allowed under GPL terms, which means source, license, and copyright notices must remain available.

Credits

Disclaimer

This repository is provided for educational purposes only.

No warranties are provided regarding accuracy, completeness, or suitability for any purpose. Use at your own risk. The authors and maintainers assume no liability for damages, legal issues, or warranty breaches resulting from use, modification, or distribution of this code.