Skip to content

KasimAhmic/autoit-js

AutoIt JS

Node.js bindings for AutoItX3.dll.

NPM Version GitHub License GitHub Actions Workflow Status NPM Downloads GitHub Issues GitHub Pull Requests

GitHub | NPM | Documentation

What is AutoIt JS?

AutoIt is a Windows automation tool that can be used to automate tasks on Windows. AutoIt provides its own scripting language however, it can be difficult to work with if you need to integrate Windows automation into an existing test suite.

Enter AutoIt JS.

AutoIt JS wraps the AutoItX3.dll library using Koffi to provide a simple to use interface for AutoIt. It allows you to take your existing JavaScript/TypeScript test suite powered by Playwright/Cypress/Puppeteer/etc. and automate Windows programs with ease.

Documentation

Documentation for this project is generated by typedoc and can be found at https://kasimahmic.github.io/autoit-js/. As all the documentation is generated from the code, the documentation is also available inline in your editor for convenience.

Example Usage

New Asynchronous API in v2

You can use the new asynchronous API in async contexts like Playwright and Cypress tests to avoid blocking the event loop and slowing down your tests.

import { Init, Run, Send, WinClose, WinWaitActive, autoit } from '@ahmic/autoit-js';

autoit.load();

await Init();
await Run('notepad.exe');
await WinWaitActive('[CLASS:Notepad]');
await Send('Hello, World!');
await WinClose('[CLASS:Notepad]');

autoit.unload();

Synchronous API

For simple scripting tasks, the synchronous API is the preferred way to use AutoIt JS.

import { InitSync, RunSync, SendSync, WinCloseSync, WinWaitActiveSync, autoit } from '@ahmic/autoit-js';

autoit.load();

InitSync();
RunSync('notepad.exe');
WinWaitActiveSync('[CLASS:Notepad]');
SendSync('Hello, World!');
WinCloseSync('[CLASS:Notepad]');

autoit.unload();

About

Node.js bindings for AutoIt

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •