New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-native-win-utils

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

node-native-win-utils

Native addon for Node.js providing utility operations on Windows systems

unpublished
Source
npmnpm
Version
2.2.1
Version published
Weekly downloads
28
27.27%
Maintainers
1
Weekly downloads
 
Created
Source

License Node-API v8 npm version npm downloads Platform: Windows only

Node Native Win Utils

I did it for myself because I didn't feel like dealing with libraries like 'node-ffi' to implement this functionality. Maybe someone will find it useful. It's WINDOWS OS ONLY

Features

  • Global keyboard event listener (keyDown / keyUp)
  • Window information & screenshots
  • Mouse movement, clicks, drag & drop
  • Keyboard emulation (keyPress, typeString)
  • OpenCV integration (template matching, blur, grayscale, histogram equalization, color manipulation, ROI, drawing)
  • Tesseract OCR text recognition
  • Screen capture
  • Mouse event listener
  • Prebuilt binaries (no Python or build tools required on Windows)
  • ESM + CommonJS support

Requirements

  • Windows 10 or later (x64)
  • Node.js >= 18 (prebuilts for recent versions via prebuildify)

Installation

npm install node-native-win-utils

Usage

import {
  KeyboardListener,
  KeyCodeHelper,
  KeyListener,
  getWindowData,
  captureWindow,
  captureWindowN,
  captureScreenToFile,
  mouseMove,
  mouseClick,
  mouseDrag,
  typeString,
  keyPress,
  textRecognition,
  OpenCV,
  startMouseListener,
  stopMouseListener,
} from "node-native-win-utils";

Keyboard

// Singleton listener
const listener = KeyboardListener.listener();
listener.on("keyDown", (data) => console.log("Down:", data.keyName));
listener.on("keyUp", (data) => console.log("Up:", data.keyName));

// Simulate key press
keyPress(KeyCodeHelper.A);           // once
keyPress(KeyCodeHelper.Enter, 2);    // twice

Mouse & Typing

mouseMove(500, 300);
mouseClick();                    // left click
mouseClick("right");
mouseDrag(100, 100, 800, 600, 50); // optional speed

typeString("Hello from Node!", 30); // 30ms delay per char

Window Operations

const data = getWindowData("Notepad");
console.log(data); // { width, height, x, y }

captureWindow("Notepad", "screenshot.png");
const buffer = captureWindowN("Notepad"); // Buffer

Screen Capture

await captureScreenToFile("full-screen.png");

Text Recognition (Tesseract OCR)

import path from "path";

const text = textRecognition(
  path.join(__dirname, "traineddata"), // path to .traineddata files
  "eng",
  path.join(__dirname, "image.png")
);
console.log(text);

OpenCV (image processing)

import { OpenCV } from "node-native-win-utils";

const img = new OpenCV("image.png"); // or ImageData { width, height, data: Uint8Array }

// Chainable methods
const processed = img
  .blur(5, 5)
  .bgrToGray()
  .equalizeHist()
  .darkenColor([240, 240, 240], [255, 255, 255], 0.5) // lower, upper, factor
  .drawRectangle([10, 10], [200, 100], [255, 0, 0], 3)
  .getRegion([50, 50, 300, 200]);

processed.imwrite("processed.png");

// Template matching
const match = img.matchTemplate(templateImage, /* method */, /* mask */);
console.log(match); // { minValue, maxValue, minLocation, maxLocation }

Mouse Event Listener

startMouseListener(({ x, y, type }) => {
  console.log(`${type} at ${x},${y}`); // move at 400 300
});

mouseClick("left"); // trigger event

// terminates a thread
stopMouseListener(); 

Building from source

npm install
npm run build

Requires:

Visual Studio Build Tools (C++).
Python 3

License

--

OpenCV License

MIT License

Made with ❤️ for Windows automation.
Issues / PRs welcome!

Keywords

node.js

FAQs

Package last updated on 10 Mar 2026

Did you know?

Socket

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.

Install

Related posts