Gathering detailed insights and metrics for robotjs
Gathering detailed insights and metrics for robotjs
npm install robotjs
Typescript
Module System
Node Version
NPM Version
91.9
Supply Chain
97.2
Quality
72.5
Maintenance
100
Vulnerability
79.9
License
C (84.46%)
C++ (7.67%)
JavaScript (4.94%)
Objective-C (2.43%)
Python (0.5%)
Total Downloads
16,791,136
Last Day
4,650
Last Week
31,466
Last Month
112,515
Last Year
1,417,187
12,449 Stars
651 Commits
976 Forks
206 Watching
29 Branches
50 Contributors
Minified
Minified + Gzipped
Latest Version
0.6.0
Package Id
robotjs@0.6.0
Size
86.98 kB
NPM Version
6.9.0
Node Version
10.16.3
Publised On
08 Dec 2019
Cumulative downloads
Total Downloads
Last day
27.7%
4,650
Compared to previous day
Last week
33.6%
31,466
Compared to previous week
Last month
-32.9%
112,515
Compared to previous month
Last year
0.3%
1,417,187
Compared to previous year
3
4
Node.js Desktop Automation. Control the mouse, keyboard, and read the screen.
RobotJS supports Mac, Windows, and Linux.
This is a work in progress so the exported functions could change at any time before the first stable release (1.0.0). Ideas?
Check out some of the cool things people are making with RobotJS! Have your own rad RobotJS project? Feel free to add it!
Install RobotJS using npm:
npm install robotjs
It's that easy! npm will download one of the prebuilt binaries for your OS.
You can get npm here if you don't have it installed.
If you need to build RobotJS, see the building section. Instructions for Electron.
1// Move the mouse across the screen as a sine wave. 2var robot = require("robotjs"); 3 4// Speed up the mouse. 5robot.setMouseDelay(2); 6 7var twoPI = Math.PI * 2.0; 8var screenSize = robot.getScreenSize(); 9var height = (screenSize.height / 2) - 10; 10var width = screenSize.width; 11 12for (var x = 0; x < width; x++) 13{ 14 y = height * Math.sin((twoPI * x) / width) + height; 15 robot.moveMouse(x, y); 16}
1// Type "Hello World" then press enter. 2var robot = require("robotjs"); 3 4// Type "Hello World". 5robot.typeString("Hello World"); 6 7// Press enter. 8robot.keyTap("enter");
1// Get pixel color under the mouse. 2var robot = require("robotjs"); 3 4// Get mouse position. 5var mouse = robot.getMousePos(); 6 7// Get pixel color in hex format. 8var hex = robot.getPixelColor(mouse.x, mouse.y); 9console.log("#" + hex + " at x:" + mouse.x + " y:" + mouse.y);
Read the Wiki for more information!
The RobotJS API is hosted at https://robotjs.io/docs/syntax.
Please ensure you have the required dependencies before installing:
npm install --global --production windows-build-tools
from an elevated PowerShell or CMD.exe)sudo apt-get install libxtst-dev libpng++-dev
).Install node-gyp using npm:
npm install -g node-gyp
Then build:
node-gyp rebuild
See the node-gyp readme for more details.
Module | Status | Notes |
---|---|---|
Mouse | 100% | All planned features implemented. |
Keyboard | 100% | All planned features implemented. |
Screen | 85% | Image search, pixel search. |
Bitmap | 0% | Saving/opening, png support. |
Not currently, and I don't know if it ever will. I personally use Electron/NW.js for global hotkeys, and this works well. Later on I might add hotkey support or create a separate module. See #55 for details.
Soon! This is a bit more complicated than the rest of the features, so I saved it for last. Luckily the code is already there, I just need to write the bindings, and I've already started. Subscribe to #13 for updates.
We've been implementing keys as we need them. Feel free to create an issue or submit a pull request!
The library doesn't have explicit multi-monitor support, so anything that works is kind of on accident. Subscribe to #88 for updates.
For any other questions please submit an issue.
I'm a huge fan of AutoHotkey, and I've used it for a very long time. AutoHotkey is great for automation and it can do a bunch of things that are very difficult in other languages. For example, it's imagesearch and pixel related functions are hard to reproduce on Mac, especially in scripting languages. These functions are great for automating apps that can't be automated like Netflix. This has never been a big deal since I've always used Windows at work, but for the past few years I've been using Mac exclusively.
I like AutoHotkey, but I like Node.js more. By developing RobotJS I get an AutoHotkey replacement on Mac (finally!), and I get to use my favorite language.
TLDR: There's nothing like AutoHotkey on Mac, so I'm making it.
MIT
Based on autopy. Maintained by Jason Stallings.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 7/8 approved changesets -- score normalized to 8
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More