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

node-native-win-utils

v2.2.3

Published

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

Readme

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");
mouseClick("left", "down") // left button down
mouseClick("left", "up") // left button up
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!