@dvnllrt/enigo-napi-rs
v1.3.2
Published
Template project for writing node package with napi-rs
Maintainers
Readme
@dvnllrt/enigo-napi-rs
Node.js bindings for enigo — a Rust library for mouse and keyboard control.
Supported platforms
Build and publish are configured for macOS and Windows only
Install
pnpm add @dvnllrt/enigo-napi-rs
# or
npm install @dvnllrt/enigo-napi-rsAPI
import {
moveMouseRel,
moveMouseAbs,
mouseClick,
mouseDown,
mouseUp,
mouseScroll,
} from '@dvnllrt/enigo-napi-rs'
// Move the cursor relative to its current position
moveMouseRel(10, -5)
// Move to absolute screen coordinates
moveMouseAbs(500, 300)
// Click, press, and release a button
mouseClick('left') // 'left' | 'right' | 'middle'
mouseDown('left')
mouseUp('left')
// Scroll: length is the amount, isVertical is the axis (true = vertical)
mouseScroll(3, true)Development requirements
corepack enable
pnpm installBuild
Release (local, current OS)
pnpm buildProduces enigo-napi-rs.<platform>.node in the project root.
Debug build
pnpm build:debugCI and release
GitHub Actions runs on every push to main:
- Lint —
oxlint,cargo fmt,clippy - Build — compile all targets from
package.json - Publish — publish to npm on versioned release commits
To release:
npm version patch # or minor / major
git pushDo not publish manually with npm publish — CI handles that.
License
MIT
