@robinpath/screen
0.1.0PublicScreen 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
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
| Function | Description |
|---|---|
screen.capture | Take a full screenshot and save to file |
screen.captureRegion | Capture a specific rectangular region of the screen |
screen.captureWindow | Capture a specific window by its title (falls back to full screen if not found) |
screen.ocr | Extract text from an image using OCR (tesseract.js) |
screen.ocrRegion | Extract text from a rectangular region of an image |
screen.setLanguage | Set the default OCR language (eng, rus, deu, fra, spa, chi_sim, jpn, kor, ron, etc.) |
screen.listDisplays | List all available displays/monitors |
screen.compare | Compare 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
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
@robinpath/api
HTTP client for making requests to external APIs with profiles, auth, download/upload, and auto-JSON parsing
@robinpath/auth
API authentication helpers (Basic, Bearer, API key, HMAC) for RobinPath
@robinpath/browser
Headless browser automation with Puppeteer: launch browsers, navigate pages, interact with elements, take screenshots, generate PDFs, and scrape data
@robinpath/cookie
HTTP cookie parsing, serialization, signing/verification, Set-Cookie handling, and cookie jar management
$ robinpath install @robinpath/screen
