{"_id":"@arifnpm/robotjs","name":"@arifnpm/robotjs","dist-tags":{"latest":"0.6.0-a"},"versions":{"0.6.0-a":{"name":"@arifnpm/robotjs","version":"0.6.0-a","description":"Node.js Desktop Automation.","main":"index.js","typings":"index.d.ts","scripts":{"test":"run-script-os","test:darwin:linux":"jasmine test/**/*.js","test-keyboard":"node test/keyboard.js","test:win32":"jasmine test/**/*.js","install":"prebuild-install || node-gyp rebuild","install-debug":"prebuild-install || node-gyp rebuild --debug","prebuild":"prebuild --all"},"repository":{"type":"git","url":"git+https://github.com/octalmage/robotjs.git"},"keywords":["Automation","GUI","mouse","keyboard","screenshot","image","pixel","desktop","robotjs","screen","recognition","autohotkey","machine","learning","color"],"author":{"name":"Jason Stallings"},"license":"MIT","gypfile":true,"bugs":{"url":"https://github.com/octalmage/robotjs/issues"},"homepage":"https://github.com/octalmage/robotjs","dependencies":{"nan":"^2.14.2","prebuild-install":"^5.3.3"},"devDependencies":{"tape":"^4.8.0","jasmine":"^2.99.0","node-gyp":"^9.4.0","prebuild":"^9.1.1","run-script-os":"^1.0.3","targetpractice":"0.0.7"},"gitHead":"8ae87a91f06f49559f0db387bc2bd1ea01419880","_id":"@arifnpm/robotjs@0.6.0-a","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-hdnWQzXFpvtfGqFMYm+jrLVtHu7fna2XMXh886hxtfodtwkJ9U4zKE4puuurks+YkhACqQR+73Phz6HI8uES7w==","shasum":"07a4f1eb1bf45cb3b68b5120d605fafb6006913a","tarball":"https://registry.npmjs.org/@arifnpm/robotjs/-/robotjs-0.6.0-a.tgz","fileCount":70,"unpackedSize":360969,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvu4UunxMz7rJpBl74zDc/X4SX3yzmTq2O9J/EajzS6QIgQSMK6YJXsywht15Nuw2Jq5U/AR5SBs0FZncPftOlNtQ="}]},"_npmUser":{"name":"arifnpm","email":"arifnpm@gmail.com"},"directories":{},"maintainers":[{"name":"arifnpm","email":"arifnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/robotjs_0.6.0-a_1695219129432_0.5578840220094436"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-20T14:12:09.269Z","0.6.0-a":"2023-09-20T14:12:09.719Z","modified":"2023-09-20T14:12:09.981Z"},"maintainers":[{"name":"arifnpm","email":"arifnpm@gmail.com"}],"description":"Node.js Desktop Automation.","homepage":"https://github.com/octalmage/robotjs","keywords":["Automation","GUI","mouse","keyboard","screenshot","image","pixel","desktop","robotjs","screen","recognition","autohotkey","machine","learning","color"],"repository":{"type":"git","url":"git+https://github.com/octalmage/robotjs.git"},"author":{"name":"Jason Stallings"},"bugs":{"url":"https://github.com/octalmage/robotjs/issues"},"license":"MIT","readme":"<p align=\"center\"><img src=\"https://cldup.com/1ATDf2JMtv.png\"></p>\r\n\r\n<p align=\"center\"><a href=\"https://travis-ci.org/octalmage/robotjs\"><img src=\"https://api.travis-ci.org/octalmage/robotjs.svg?branch=master\"></a> <a href=\"https://ci.appveyor.com/project/octalmage/robotjs\"><img src=\"https://ci.appveyor.com/api/projects/status/qh2eqb37j7ap6x36?svg=true\"></a> <a href=\"https://www.npmjs.com/package/robotjs\"><img src=\"https://img.shields.io/npm/v/robotjs.svg\"></a> <a href=\"https://gitter.im/octalmage/robotjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\"><img src=\"https://img.shields.io/badge/gitter-join%20chat-blue.svg\"></a> <a href=\"http://waffle.io/octalmage/robotjs\"><img src=\"https://img.shields.io/waffle/label/octalmage/robotjs/ready.svg?maxAge=3600\"></a></p>\r\n\r\n> Node.js Desktop Automation. Control the mouse, keyboard, and read the screen.\r\n\r\nRobotJS supports Mac, [Windows](https://github.com/octalmage/robotjs/issues/2), and [Linux](https://github.com/octalmage/robotjs/issues/17).\r\n\r\nThis is a work in progress so the exported functions could change at any time before the first stable release (1.0.0). [Ideas?](https://github.com/octalmage/robotjs/issues/4)\r\n\r\n[Check out some of the cool things people are making with  RobotJS](https://github.com/octalmage/robotjs/wiki/Projects-using-RobotJS)! Have your own rad RobotJS project? Feel free to add it!\r\n\r\n<p align=\"center\"><a href=\"https://twitter.com/robotjavascript\"><img width=\"300\" src=\"https://cldup.com/Et-C6_ue45.png\"></a><a href=\"http://blog.robotjs.io\"><img width=\"300\" src=\"https://cldup.com/3apDirNmSB.png\"></a></p>\r\n\r\n## Contents\r\n\r\n- [Installation](#installation)\r\n- [Examples](#examples)\r\n- [API](https://robotjs.io/docs/syntax)\r\n- [Building](#building)\r\n- [Plans](#plans)\r\n- [Progress](#progress)\r\n- [FAQ](#faq)\r\n- [License](#license)\r\n\r\n## Installation\r\n\r\nInstall RobotJS using npm:\r\n\r\n```\r\nnpm install robotjs\r\n```\r\nIt's that easy! npm will download one of the prebuilt [binaries](https://github.com/octalmage/robotjs/releases/latest) for your OS.\r\n\r\nYou can get npm [here](https://nodejs.org/en/download/) if you don't have it installed.\r\n\r\nIf you need to build RobotJS, see the [building](#building) section. Instructions for [Electron](https://github.com/octalmage/robotjs/wiki/Electron).\r\n\r\n## Examples\r\n\r\n##### [Mouse](https://github.com/octalmage/robotjs/wiki/Syntax#mouse)\r\n\r\n<p align=\"center\"><img src=\"https://cldup.com/lugVjjAkEi.gif\"></p>\r\n\r\n```JavaScript\r\n// Move the mouse across the screen as a sine wave.\r\nvar robot = require(\"robotjs\");\r\n\r\n// Speed up the mouse.\r\nrobot.setMouseDelay(2);\r\n\r\nvar twoPI = Math.PI * 2.0;\r\nvar screenSize = robot.getScreenSize();\r\nvar height = (screenSize.height / 2) - 10;\r\nvar width = screenSize.width;\r\n\r\nfor (var x = 0; x < width; x++)\r\n{\r\n\ty = height * Math.sin((twoPI * x) / width) + height;\r\n\trobot.moveMouse(x, y);\r\n}\r\n```\r\n\r\n##### [Keyboard](https://github.com/octalmage/robotjs/wiki/Syntax#keyboard)\r\n\r\n```JavaScript\r\n// Type \"Hello World\" then press enter.\r\nvar robot = require(\"robotjs\");\r\n\r\n// Type \"Hello World\".\r\nrobot.typeString(\"Hello World\");\r\n\r\n// Press enter.\r\nrobot.keyTap(\"enter\");\r\n```\r\n\r\n##### [Screen](https://github.com/octalmage/robotjs/wiki/Syntax#screen)\r\n\r\n```JavaScript\r\n// Get pixel color under the mouse.\r\nvar robot = require(\"robotjs\");\r\n\r\n// Get mouse position.\r\nvar mouse = robot.getMousePos();\r\n\r\n// Get pixel color in hex format.\r\nvar hex = robot.getPixelColor(mouse.x, mouse.y);\r\nconsole.log(\"#\" + hex + \" at x:\" + mouse.x + \" y:\" + mouse.y);\r\n```\r\nRead the [Wiki](https://github.com/octalmage/robotjs/wiki) for more information!\r\n\r\n## [API](http://robotjs.io/docs/syntax)\r\n\r\nThe RobotJS API is hosted at <https://robotjs.io/docs/syntax>.\r\n\r\n## Building\r\n\r\nPlease ensure you have the required dependencies before installing:\r\n\r\n* Windows\r\n  * windows-build-tools npm package (`npm install --global --production windows-build-tools` from an elevated PowerShell or CMD.exe)\r\n* Mac\r\n  * Xcode Command Line Tools.\r\n* Linux\r\n  * Python (v2.7 recommended, v3.x.x is not supported).\r\n  * make.\r\n  * A C/C++ compiler like GCC.\r\n  * libxtst-dev and libpng++-dev (`sudo apt-get install libxtst-dev libpng++-dev`).\r\n\r\nInstall node-gyp using npm:\r\n\r\n```\r\nnpm install -g node-gyp\r\n```\r\n\r\nThen build:\r\n\r\n```\r\nnode-gyp rebuild\r\n```\r\n\r\nSee the [node-gyp readme](https://github.com/nodejs/node-gyp#installation) for more details.\r\n\r\n## Plans\r\n\r\n* √ Control the mouse by changing the mouse position, left/right clicking, and dragging.\r\n* √ Control the keyboard by pressing keys, holding keys down, and typing words.\r\n* √ Read pixel color from the screen and capture the screen.\r\n* Find an image on screen, read pixels from an image.\r\n* Possibly include window management?\r\n\r\n## Progress\r\n\r\n| Module        | Status        | Notes   |\r\n| ------------- |-------------: | ------- |\r\n| Mouse         | 100%           | All planned features implemented.       |\r\n| Keyboard      | 100%           | All planned features implemented.       |\r\n| Screen        | 85%            | Image search, pixel search. |\r\n| Bitmap        | 0%             |  Saving/opening, png support.  |\r\n\r\n## FAQ\r\n\r\n#### Does RobotJS support global hotkeys? \r\n\r\nNot currently, and I don't know if it ever will. I personally use [Electron](http://electron.atom.io/)/[NW.js](http://nwjs.io/) for global hotkeys, and this works well. Later on I might add hotkey support or create a separate module. See [#55](https://github.com/octalmage/robotjs/issues/55) for details. \r\n\r\n#### Can I take a screenshot with RobotJS? \r\n\r\nSoon! 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](https://github.com/octalmage/robotjs/issues/13) for updates. \r\n\r\n#### Why is &#60;insert key&#62; missing from the keyboard functions? \r\n\r\nWe've been implementing keys as we need them. Feel free to create an issue or submit a pull request!\r\n\r\n#### How about multi-monitor support?\r\n\r\nThe library doesn't have explicit multi-monitor support, so anything that works is kind of on accident. Subscribe to [#88](https://github.com/octalmage/robotjs/issues/88) for updates.\r\n\r\nFor any other questions please [submit an issue](https://github.com/octalmage/robotjs/issues/new).\r\n\r\n## Story\r\n\r\nI'm a huge fan of [AutoHotkey](https://www.autohotkey.com/), 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](https://www.autohotkey.com/docs/commands/ImageSearch.htm) and [pixel](https://www.autohotkey.com/docs/commands/PixelGetColor.htm) 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](http://blueshirtdesign.com/apps/autoflix/). 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. \r\n\r\nI 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. \r\n\r\n**TLDR:** There's nothing like AutoHotkey on Mac, so I'm making it. \r\n\r\n## License\r\n\r\nMIT\r\n\r\nBased on [autopy](https://github.com/msanders/autopy). \r\nMaintained by [Jason Stallings](http://jason.stallin.gs).\r\n","readmeFilename":"README.md"}