bezier-mouse-js

1.1.3 • Public • Published

bezier-mouse-js

bezier-mouse-js is a lightweight javascript library to mirror human-like mouse movements with Bézier curves.

Getting Started

Install the bezier-mouse-js package:

npm install bezier-mouse-js

Simple usage:

const BezierMouse = require("bezier-mouse-js");

(async () => {
  const bezMouse = new BezierMouse();
  await bezMouse.moveAndClick({ x: 100, y: 100 }, { x: 700, y: 700 });
  await bezMouse.moveAndDoubleClick({ x: 700, y: 700 }, { x: 100, y: 100 });
})();

Documentation Here (API Docs)

Demo Here

Demo Examples:

Advanced usage:

const BezierMouse = require("bezier-mouse-js");

(async () => {
  const bezMouse = new BezierMouse(75);
  await bezMouse.moveAndDoubleClick(
    { x: 100, y: 100 },
    { x: 700, y: 700 },
    "LEFT",
    { steps: 110, deviation: 45, flip: false }
  );
  await bezMouse.moveAndDoubleClick({ x: 700, y: 700 }, { x: 150, y: 150 });
})();

Underlying mouse control framework: https://nutjs.dev/

Package Sidebar

Install

npm i bezier-mouse-js

Weekly Downloads

7

Version

1.1.3

License

MIT

Unpacked Size

8.08 kB

Total Files

5

Last publish

Collaborators

  • chrisdewolf