
Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Site | NPM Module | GitHub Repo
automately is the official npm module of AutoMately, a free module for automating mouse and keyboard inputs on Mac, Windows, and Linux.
Install with npm if you plan to use automately
in a Node project or in the browser.
npm install automately
const { keyboard, Key, mouse, Button, screen, Region } = require('automately');
After you have followed the install step, you can start using automately
to create custom text snippets that you can access on all of your devices
For a more in-depth documentation of this library and the AutoMately service, please visit the official AutoMately website.
keyboard.config.autoDelayMs = 100;
keyboard.type(...keysOrText);
Types given keys or strings.
Example:
await keyboard.type(Key.LeftSuper, Key.Space);
await keyboard.type('calculator);
keyboard.pressKey(...keys);
Presses and holds multiple keys.
Example:
await keyboard.pressKey(Key.LeftAlt, Key.F4);
await keyboard.releaseKey(Key.LeftAlt, Key.F4);
keyboard.releaseKey(...keys);
Releases multiple keys.
Example:
await keyboard.pressKey(Key.LeftAlt, Key.F4);
await keyboard.releaseKey(Key.LeftAlt, Key.F4);
mouse.config.autoDelayMs = 100;
mouse.config.mouseSpeed = 1000;
mouse.setPosition(point);
Moves the mouse cursor to a given position instantly.
Example:
await mouse.setPosition(new Point(500, 500));
mouse.getPosition();
Returns a Promise resolving to the current cursor position.
Example:
const position = await mouse.getPosition();
console.log(position); // Point { x: 500, y: 500 }
mouse.move(path, movementFunction);
Moves the mouse cursor along a given path.
Example:
await mouse.move(straightTo(centerOf(await screen.find('image.png'))));
screen.config.confidence = 0.95;
screen.config.autoHighlight = true;
screen.config.highlightDurationMs = 500;
screen.config.highlightOpacity = 0.7;
screen.config.resourceDirectory = '/path/to/resources';
screen.capture(filePath);
Captures a screenshot and stores it to the filesystem.
Example:
await screen.capture('/path/to/screenshot.png');
screen.captureRegion(region, filePath);
Captures a screenshot of a specific region and stores it to the filesystem.
Example:
const region = new Region(0, 0, 100, 100);
await screen.captureRegion(region, '/path/to/region_screenshot.png');
screen.find(imageResource);
Finds a match for a given image on the screen.
Example:
await mouse.move(straightTo(centerOf(await screen.find('image.png'))));
screen.findAll(imageResource);
Finds all matches for a given image on the screen.
Example:
const matches = await screen.findAll('image.png');
for (const match of matches) {
await mouse.move(straightTo(centerOf(match)));
}
screen.highlight(region);
Displays an opaque window overlay for easier visual follow-up.
Example:
await screen.highlight(await screen.find('image.png'));
screen.on(query, callback);
Registers callbacks executed upon finding a match for a template image.
Example:
const colorQuery = pixelWithColor(new RGBA(0, 0, 0, 255));
const secondQuery = pixelWithColor(new RGBA(43, 45, 48, 255));
screen.on(colorQuery, async (matchResult) => {
await mouse.move(straightTo(matchResult.location));
});
screen.on(secondQuery, async (matchResult) => {
console.log('Second query found');
});
await screen.find(colorQuery); // Triggers callback
await mouse.move(straightTo(new Point(100, 100)));
await screen.find(secondQuery); // Triggers callback
await screen.find(colorQuery); // Triggers callback again
screen.waitFor(imageResource, timeoutMs, intervalMs);
Waits for a match for a given image on the screen within a specified timeout.
Example:
await mouse.move(straightTo(centerOf(await screen.waitFor('image.png', 3000, 500))));
screen.colorAt(point);
Returns RGBA color information at a specified pixel location.
Example:
const color = await screen.colorAt(new Point(0, 0));
console.log(color); // RGBA { R: 0, G: 0, B: 0, A: 255 }
screen.width();
Returns the main screen's width in pixels.
Example:
const width = await screen.width();
console.log(width); // e.g. 1920
screen.height();
Returns the main screen's height in pixels.
Example:
const height = await screen.height();
console.log(height); // e.g. 1080
AutoMately is a free text snippet manager that lets you create custom text snippets that you can access on all of your devices!
If you are still having difficulty, we would love for you to post a question to the AutoMately issues page. It is much easier to answer questions that include your code and relevant files! So if you can provide them, we'd be extremely grateful (and more likely to help you find the answer!)
Ask us to have your project listed! :)
FAQs
Native system automation for node.js
The npm package automately receives a total of 9 weekly downloads. As such, automately popularity was classified as not popular.
We found that automately demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.