Modules@robinpath/screen

@robinpath/screen

0.1.0Public

Screen capture and OCR: screenshots, region capture, window capture, and text extraction

@robinpath/screen

Screen capture and OCR: take screenshots (full, region, window), extract text from images with tesseract.js, list displays, and compare images

Category Functions Auth License

Why use this module?

The screen module lets you:

  • Take a full screenshot and save to file
  • Capture a specific rectangular region of the screen
  • Capture a specific window by its title (falls back to full screen if not found)
  • Extract text from an image using OCR (tesseract.js)
  • Extract text from a rectangular region of an image

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/screen

Quick Start

No credentials needed — start using it right away:

screen.captureRegion "./region.png" 100 100 400 300

Available Functions

FunctionDescription
screen.captureTake a full screenshot and save to file
screen.captureRegionCapture a specific rectangular region of the screen
screen.captureWindowCapture a specific window by its title (falls back to full screen if not found)
screen.ocrExtract text from an image using OCR (tesseract.js)
screen.ocrRegionExtract text from a rectangular region of an image
screen.setLanguageSet the default OCR language (eng, rus, deu, fra, spa, chi_sim, jpn, kor, ron, etc.)
screen.listDisplaysList all available displays/monitors
screen.compareCompare two images byte-by-byte to check if they are identical

Examples

Capture a specific rectangular region of the screen

screen.captureRegion "./region.png" 100 100 400 300

Capture a specific window by its title (falls back to full screen if not found)

screen.captureWindow "./notepad.png" "Untitled - Notepad"

Extract text from an image using OCR (tesseract.js)

screen.ocr "./screenshot.png"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/screen";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  screen.captureRegion "./region.png" 100 100 400 300
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/screen
Version0.1.0
LicenseMIT
Unpacked Size6.1 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

web