npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

win-auto-workspace

v0.1.2

Published

Windows desktop automation framework skeleton with TS API, CLI, and napi-rs native addon.

Readme

win-auto

npm version npm version License: MIT

Windows desktop automation framework for Node.js and TypeScript

Automate Windows desktop applications with a simple TypeScript/JavaScript API. Launch apps, find UI elements, and simulate user interactions.

Features

  • 🚀 Simple TypeScript API - Clean, intuitive interface for desktop automation
  • 🔧 Native Performance - Rust + napi-rs backend for fast, reliable automation
  • 🎯 Element Finding - Locate UI elements by role, name, and other attributes
  • ⌨️ User Simulation - Type text, click buttons, interact with controls
  • 📦 CLI Tool - Scaffold new automation projects quickly
  • 🧪 Testing Integration - Built-in support for vitest testing

Quick Start

Installation

npm install win-auto-core

For the CLI tool:

npm install -g win-auto

Basic Usage

import { Automation } from "win-auto-core";

// Launch an application
const automation = new Automation();
const app = await automation.launch("C:\\Windows\\System32\\notepad.exe");

// Find an element
const textbox = await app.find({ role: "textbox" });

// Interact with it
await textbox?.type("Hello from win-auto!");

Using the CLI

Create a new automation project:

win-auto init my-automation-project
cd my-automation-project
npm install
npm run test

API Reference

Automation

Main entry point for desktop automation.

const automation = new Automation();

// Launch an application and get an App instance
const app = await automation.launch(executablePath);

// Or use the lower-level API
const app = await automation.launchApp({ executablePath });

App

Represents a launched application.

// Get the main window
const mainWindow = await app.getMainWindow();

// Find elements in the app
const element = await app.find({ role: "button", name: "OK" });

Window

Represents a window in the application.

// Find elements within a window
const element = await window.findElement({ role: "textbox" });

// Get window properties
const title = await window.getTitle();

Element

Represents a UI element (button, textbox, etc.).

// Interact with elements
await element.typeText("Hello");
await element.click();

// Get element properties
const name = await element.getName();
const role = await element.getRole();

Supported Elements

  • TextBox - Type text into input fields
  • Button - Click buttons
  • ComboBox - Select items from dropdowns
  • CheckBox - Toggle checkboxes
  • And more standard Windows UI elements

Examples

Automating Notepad

import { Automation } from "win-auto-core";

async function automateNotepad() {
  const automation = new Automation();

  // Launch Notepad
  const app = await automation.launch("C:\\Windows\\System32\\notepad.exe");

  // Find the text input
  const textbox = await app.find({ role: "textbox" });

  // Type some text
  await textbox?.type("This is an automated message!\n");
  await textbox?.type("win-auto makes it easy!");
}

automateNotepad().catch(console.error);

Finding Elements

// Find by role
const button = await app.find({ role: "button" });

// Find by name
const okButton = await app.find({ name: "OK" });

// Find by multiple attributes
const saveButton = await app.find({ role: "button", name: "Save" });

Testing with vitest

import { describe, it, expect } from "vitest";
import { Automation } from "win-auto-core/testing";

describe("Notepad Automation", () => {
  it("should type text in notepad", async () => {
    const automation = new Automation();
    const app = await automation.launch("notepad.exe");
    const textbox = await app.find({ role: "textbox" });

    await textbox?.type("Test message");
    expect(textbox).toBeDefined();
  });
});

Requirements

Runtime

  • Windows 10 / Windows 11 or later
  • Node.js 18+
  • npm 9+

Development

Packages

This monorepo contains:

Development

Setup

git clone https://github.com/mihailDamchevski/win-auto.git
cd win-auto
npm install

Build

# Build TypeScript packages
npm run build

# Build native addon (requires Rust)
npm run build:native

Testing

# Unit tests
npm run test

# E2E tests with mock runtime
npm run test:e2e

# Real UI tests (interactive, requires desktop)
REAL_UI_TEST=1 npm run test:e2e:real

Clean

npm run clean

Troubleshooting

"Module not found" error

Make sure the native addon is built:

npm run build:native

Cannot find executable

Use the full path to the application:

const app = await automation.launch("C:\\Program Files\\MyApp\\myapp.exe");

Element not found

Try waiting a moment for the UI to render:

await new Promise((resolve) => setTimeout(resolve, 500));
const element = await app.find({ role: "button" });

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

MIT - see LICENSE for details

Changelog

See CHANGELOG.md for version history.


Note: This package is optimized for Windows platforms. Cross-platform support for macOS and Linux is not currently planned.

CLI usage

node packages/cli/dist/index.js init demo-project
cd demo-project
npm install
npm test